InterviewHubPRO
Section Overview
Q228

Question 228 of 521

Part 4: Prototypes, Object Methods & Event Loop (174 - 253)

44%
JavaScript Internals (521 Qs)•Part 4: Prototypes, Object Methods & Event Loop (174 - 253)

What are primitive data types

A primitive data type is data that has a primitive value (which has no properties or methods). There are 7 types of primitive data types.

  1. string
  2. number
  3. boolean
  4. null
  5. undefined
  6. bigint
  7. symbol

Practical Code Example

javascript
// 7 Primitive Data Types in JavaScript (stored by value, immutable):
const str = "hello";       // string
const num = 42;            // number
const big = 9007199254740991n; // bigint
const bool = true;         // boolean
const sym = Symbol("id");  // symbol
const und = undefined;     // undefined
const nul = null;          // null