Mobile development

Stage 1 · Lesson 1 of 9

Values, types and equality

JavaScript and TypeScript

has a handful of simple , called : string, number, boolean, null, undefined, bigint and symbol. Everything else is an object, including arrays and functions. Declare values with const by default and let when you reassign; skip var.

Primitives are compared by value. Objects are compared by reference, meaning "is this the very same object?". So {} === {} is false, and that is exactly how React decides whether something changed.

Always use === rather than ==, which converts types first and makes 0 == '' true. Learn the oddities that cause real bugs: typeof null is 'object', NaN is not equal to itself, and 0.1 + 0.2 is not exactly 0.3.

A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

  • CoursePaid
    Grokking JavaScript Fundamentals

    Design Gurus · Beginner · $50

    Beginner JavaScript with an exercise after most lessons

  • GuideFree
    JavaScript.info

    Ilya Kantor

    Free and thorough: Part 1 is the language, skip the browser chapters in Part 2

Practise

  • Dart, TypeScript, Kotlin and Swift tracks with small exercises and free mentor feedback

Keep handy

Also worth your time

Mark this stage as not done?