Programming foundations

Stage 1 · Lesson 6 of 10

Arrays and objects

Your first language

hold values in order, and objects hold named properties. Together they model almost all data in JavaScript. Learn the array methods you will use daily: push, pop, includes and indexOf.

Then learn the ones that take a : forEach, map, filter, find and reduce. map and filter return new arrays, while push, sort and splice change the original. sort also compares items as strings by default, so [10, 9, 1].sort() gives [1, 10, 9].

Read object properties with a dot (user.name) or brackets (user["name"]), and loop over them with Object.keys and Object.entries. The built-in and (Map and Set) are better when keys are not simple strings, or when you need unique values. make unpacking and copying short.

A question to check yourself, an AI practice session and 4 cheat sheet entries come when you add the roadmap to your account. Add it

Resources for this stage

Start with· follow one of these

  • CoursePaid
    Grokking JavaScript Fundamentals

    Design Gurus · Beginner · $50

    The language itself, closures and async included, with runnable exercises per lesson

  • GuideFree
    JavaScript.info

    Ilya Kantor

    Free: Part 1 is the most complete modern JavaScript tutorial, with tasks per chapter

Practise

  • Small exercises in your language track, with free feedback from a human mentor

  • Foundations path: the JavaScript basics lessons and the exercises repo with tests

Keep handy

  • The JavaScript reference: look up every array and string method here

Mark this stage as not done?