Find the right help card
Before you start this beginner track
Variables, strings, and function calls. Array callbacks are introduced in later missions.
Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.
Understand it, then try it.
An object groups related properties, and an array can hold several objects. find checks them in order and returns the first object whose test is true. Accessing that object’s title and minutes gives the card details. This example includes a matching slug, so the result is defined.
const cards = [ { slug: "start", title: "Welcome", minutes: 1 }, { slug: "help", title: "Help", minutes: 3 }];const selected = cards.find(card => card.slug === "help");console.log(`${selected.title} (${selected.minutes} min)`);Run each standalone ES2020+ script in Node.js or a browser console. These examples simulate interface data; no HTML or DOM setup is required. Read only console.log output.
Track the values line by line. Predict the result before running this example in your own editor.