JavaScript Tutorial

The language for programming web pages.

JS Data Types

JavaScript Data Types

JavaScript has 8 data types. The typeof operator returns the type of a variable.

Primitive Types:

  • String — text: "Hello"
  • Number — numeric: 42, 3.14
  • BigInt — large integers: 9007199254740991n
  • Booleantrue / false
  • Undefined — declared but no value
  • Null — intentionally empty
  • Symbol — unique identifier

Reference Type:

  • Object — arrays, objects, functions

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics