Your port can take a chip row apart and join the two start waves into one array of records. Each line on the results page, though, needs only a few fields from one runner, and the Python script reads them one lookup at a time.
In this lesson, you’ll port those lookups to a single line that takes fields by name, which pays off most in callbacks and loops.
Take Fields by Name
In the Python script, the results line for one runner starts with a lookup per field:
name = runner["name"]
finish = runner["finish"]
print(name, finish)
For Mei Chen’s record, that prints Mei Chen 1:36:20. You may also have taken several values at once with a mapping pattern in match, as in case {"name": name, "finish": finish}:. JavaScript makes that idea a plain declaration. Here are two of Mei’s fields taken in one line:
const runner = {
bib: 23, name: "Mei Chen", group: "F35",
checkpoints: ["0:22:40", "", "1:08:55"],
finish: "1:36:20",
};
const { finish, name } = runner;
console.log(name, finish);
Each name gets the value of the property it matches:
Mei Chen 1:36:20