About Lesson
Primitives Data Types
Primitive types are basic data types that hold a single value.
1. String:
Used to represent text, enclosed within quotes (”, “”, or backticks “ `).
JavaScript
let name = "Manjeet Singh";
2. Number:
Used for both integers and floating-point numbers.
JavaScript
let age = 25;
let price = 9.99;
3. Boolean:
Represents true or false values.
JavaScript
let isVerified = true;
4. Null:
Represents an intentional absence of any value.
JavaScript
let result = null; // Explicitly empty
5. Undefined:
Represents a variable that has been declared but not yet assigned a value.
JavaScript
let x;
console.log(x); // Output: undefined
6. Symbol:
Introduced in ES6, Symbol is used to create unique values.
JavaScript
let sym = Symbol('unique');