DEV Community

Mathu varshtih
Mathu varshtih

Posted on

JavaScript Data Types

Primitive Data Types

  1. String – Represents text. "Hello"
  2. Number – Represents numbers. 25, 10.5
  3. BigInt – Represents very large integers. 123456789n
  4. Boolean – Represents true or false.
  5. Undefined – A variable with no assigned value.
  6. Null – Represents an intentional empty value.
  7. Symbol – Represents a unique identifier.

Non-Primitive Data Types

  1. Object – Stores data in key-value pairs. {name: "John"}
  2. Array – Stores multiple values. [10, 20, 30]
  3. Function – A reusable block of code. function greet() {}

Top comments (0)