This course is a first look at the JavaScript you need to write small programs straight away: names, strings, decisions, loops, functions, arrays, and objects. It’s short on purpose. JavaScript does these everyday things its own way, and the course shows you where that won’t match your Python instincts. Each topic gets a course of its own later.
Here’s one of those places. A bike-share’s dock report, in Python, works out how many bikes the
van should load, skipping the docks closed for repairs with if dock["name"] in closed:. It
prints this:
Van load: 6
Ported line for line to JavaScript, with if (dock.name in closedDocks) {, the script runs
without an error and prints this:
Van load: 11