In JavaScript, there are several data types that can be used to store and manipulate values. The most commonly used data types in JavaScript are:
Example:
let x = 5; // Integer
let y = 3.14; // Decimal
Example:
let firstName ="John";
let lastName = 'Doe';
Example:
let isAlive = true;
let isHungry = false;
Example:
let x; // Undefined
Example:
let x = null;
6. Objects: Used to store collections of data as key-value pairs.
Example:
let person = { firstName:
"John", lastName: "Doe", age: 30 };
Example:
let fruits = ["apple",
"banana", "orange"];
Example:
console.log( 'Code is Poetry' );const mySymbol = Symbol();
These data types can be used in a variety of ways to manipulate and store data in JavaScript, and it’s important to understand how they work and how to use them effectively in your code.
Learners TV is a website that is designed to educate users and provide instructional material on particular subjects and topics.