Primitive Data Types
String:
Represents textual data enclosed in quotes.
typeof "Hello" // "string"
Number:
Represents both integers and floating-point decimals.
typeof 42 // "number"
BigInt:
Used for integers too large to be safely processed by the standard Number type.
typeof 9007199254740991n
Boolean:
Represents a logical entity with only two potential states.
typeof true // "boolean"
Undefined:
Automatically assigned to variables that are declared but not yet initialized.
typeof undefined // "undefined"
Null:
Represents an intentional, empty absence of any object value.
typeof null // "object"
Non-Primitive Data Type
Object:
Used to store collections of data in key-value format.
let tech = {
type: "Company",
location: "Noida"
}
console.log(tech.type)
Arrays:
An Array is a special kind of object used to store an ordered collection of values, which can be of any data type.
`let a1 = [1, 2, 3, 4, 5];
console.log(a1);`
Function:
A function in JavaScript is a block of reusable code designed to perform a specific task when called.
function tech(){
let container= "network"
return container;
}
tech();

Top comments (0)