Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 986 Bytes

README.md

File metadata and controls

39 lines (26 loc) · 986 Bytes

04. Values and types

Recognize JavaScript primitive values and objects.

Learn

  • string
  • number
  • boolean
  • null
  • undefined
  • object
  • typeof

How it works

Primitives include strings, numbers, booleans, bigint, symbol, null, and undefined. Objects hold collections and functions. typeof helps inspect a value, but typeof null is a historical special case returning object.

Common mistake

A missing property yields undefined, which is different from a deliberately assigned null.

Guided challenge

Create one value of each common type and print typeof and a short explanation.

Run the example

Open example.html in a browser and edit example.js. Save, refresh, and use the Console and debugger to inspect values.

Completion check

  • Explain the core idea in your own words without reading the code.
  • Change one input and predict the output before running it.
  • Test one boundary or failure case, then record what you changed.