Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Welcome to the Bike-Share Dock Report

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:

Language: Program Output
Van load: 6

Ported line for line to JavaScript, with if (dock.name in closedDocks) {, the script runs without an error and prints this:

Language: Program Output
Van load: 11

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

00:01 Welcome to A First Tour of JavaScript for Pythonistas! You already know Python, and this course is your first real look at writing small programs in JavaScript.

00:11 Your project is a city bike-share’s dock report, the Python script a van crew runs before each shift, and you’ll port it to JavaScript. Here’s a first taste.

00:24 This Python script works out the van’s load: six bikes. Here’s the JavaScript port, line for line. It runs with no error, and the van gets eleven. Same docks, same rules.

00:40 Why eleven? This course shows you how JavaScript does everyday things. It won’t always match your Python instincts, and you’ll see where they bite.

00:53 The crew drives its van between docks, moving bikes from full ones to empty ones. Before each shift, a Python script prints which docks are empty, which are nearly full, and how many bikes the van needs.

01:07 The crew wants it in JavaScript, so you’ll port it, one piece at a time.

01:14 By the end, you’ll name values and build strings, make decisions and loop, write functions, and use arrays and objects. Then the project ports the whole dock report.

01:26 Each topic gets a course of its own later.

01:31 You only need to know how to write small Python programs and run a JavaScript file with the node command. You’ll need Node installed, which the Getting Started course sets up, or you can grab it from the Node website.

01:46 Short videos mix with text lessons and exercises, and every video has a summary below it. A project, then a quiz and a summary, close the course. Next up is Naming Values With const and let, a text lesson.

Become a Member to join the conversation.