Lazo Lab Sign up

Web Development / JavaScript

Lesson 19 of 30

Arrays and objects

Arrays are lists, objects are like Python dictionaries. map, filter and find are the methods you'll use most.

Key points

  • arr.filter keeps matches
  • arr.find gets the first match
  • obj.key or obj["key"]
const users = [{name: "ali", xp: 40}, {name: "sara", xp: 90}];
const pros = users.filter(u => u.xp > 50);
Watch a video on thisOpens YouTube search results for “Arrays and objects” in a new tab

Quiz · +10 XP

Which array method keeps only items that match a test?

Log in to save progress and earn XP.