‹ Start From Zero Lesson 7 of 21
Contents Lesson 7 of 21

4 min read · foundations

Objects and arrays — the shape real data arrives in

Almost every response in this track is an object, a list of objects, or an object containing a list. Learn these two and market data stops being alien.

An object is labelled values

const quote = { code: "AAPL.US", close: 309.90, volume: 25869800 };

quote.close;        // 309.90
quote["close"];     // the same
quote.missing;      // undefined — no error

That last line matters enormously. Asking an object for something it does not have gives you undefined rather than a complaint. Silence, again — and it is why a typo in a field name shows up as an empty cell rather than a crash.

An array is ordered values

const bars = [
  { date: "2026-08-24", close: 310.34 },
  { date: "2026-08-25", close: 309.90 },
];

bars.length;    // 2
bars[0].close;  // 310.34 — counting starts at zero
bars[9];        // undefined, again no error

Counting starts at zero, so the last item is at length - 1. Off-by-one at the first and last element is the most common bug in this whole track, and course 3 is largely about one specific version of it.

Three list operations do most of the work

bars.map(b => b.close)            // one output per input
bars.filter(b => b.close > 310)   // keep some
bars.find(b => b.date === "2026-08-25")  // first match, or undefined

Read them as sentences: give me the close of each, keep the ones above 310, find the one dated that. Once those three read as English, most data-handling code does.

JSON is this, as text

{"code":"AAPL.US","close":309.90,"volume":25869800}

That is what a server actually sends: the same shape, written as a string. JSON.parse turns text into an object; JSON.stringify goes the other way. Every API in this academy speaks it, and unit 3 makes your first request.

Try it now

Take the two-bar array above and, by hand, write the code for: the closes as a list, the bars above 310, and the bar dated 2026-08-25. Then ask for the bar dated 2026-01-01 and see undefined come back rather than an error. That silence is a thing you now expect.