JavaScriptJavaScript · Lesson 02

Variables & Data Types

let, const, var and the primitive types.

Video tutorialTrack course · freeCodeCamp
Speed
Next lesson
Watch 00:00 · 1 checkpoints Watch on YouTube More on this topic
Transcript & captions
7/7
  • const — cannot be reassigned. Use it by default.
  • let — reassignable, block scoped.
  • var — function scoped and hoisted. Avoid it.

Primitive types: string, number, boolean, null, undefined, bigint, symbol. Everything else (arrays, functions, dates) is an object.

Try it yourself

Knowledge check

0/1 answered

typeof null returns…