SyntaxStudy
Sign Up
JavaScript Beginner 1 min read

Data Types

JavaScript Data Types

Primitives

TypeExample
String"hello"
Number42, 3.14
Booleantrue/false
undefinedunset variable
nullintentional empty

Use typeof to check a type.

Example
let name = 'Alice';   // string
let age  = 25;        // number
let ok   = true;      // boolean
console.log(typeof name); // 'string'