0 of 3 saved

JavaScript5 min read

Data Types

Read this chapter, write the program on this page, then pass a short check to open the next one.

Primitives and objects at a glance.

Data Types

JS has primitives (number, string, boolean, null, undefined, bigint, symbol) and objects (including arrays and functions).

  • typeof null is a historical quirk ("object").
  • Numbers are IEEE floats โ€” watch precision.
  • Strings are immutable sequences of UTF-16 code units.
console.log(typeof 42, typeof "hi", typeof true, typeof undefined);

After you read this chapter, use Write (when available) and Quiz on this page to lock it in.