Thuta Learning
BasicProgrammingbeginner

JS Data Types

Relax. We'll talk through this in plain words — no textbook voice.

JavaScript has two kinds of data types: Primitive Types and Object.

Primitive Types:

string: "Hello"

number: 100, 3.14

boolean: true, false

undefined: a variable that hasn't been assigned a value yet

null: deliberately set to mean "no value"

symbol: Unique identifier

typeof operator lets you check a value's data type.

javascript
let length = 16;          // Number
let color = "Yellow";       // String
let isDone = true;          // Boolean
let car;                    // Undefined
let person = {              // Object
  firstName: "John", 
  lastName: "Doe"
};

console.log(typeof length);
console.log(typeof color);
console.log(typeof person);
You should see
number string object
JS Data Types | Thuta Learning