Loading video player…

Welcome to the Bouldering Gym's Front Desk

This course shows you where JavaScript finds a name and when it exists, and how functions keep state, take any number of arguments, call you back, and build other functions.

Your project is to port the Python script a bouldering gym’s front desk runs. Here’s a first taste. The desk’s script sets a reminder for the evening class, which ends at 20:30. At 20:10, it starts a timer of 600 seconds:

Language: Python
import threading

def remind():
    print("Learn to Boulder ends in 10 minutes")

threading.Timer(600, remind).start()
print("Reminder set")

It prints Reminder set at once, and the reminder ten minutes later:

Language: Program Output
Reminder set
Learn to Boulder ends in 10 minutes

Here’s the JavaScript port, front-desk.js, line by line with the same 600:

Language: JavaScript
const remind = () =>
  console.log("Learn to Boulder ends in 10 minutes");

setTimeout(remind, 600);
console.log("Reminder set");

Run with node front-desk.js, it logs Reminder set, then the reminder:

Language: Program Output
Reminder set
Learn to Boulder ends in 10 minutes

Look at when the lines came: Python’s reminder came 600 seconds after Reminder set, and JavaScript’s came 0.6 seconds after it. That’s nearly ten minutes early, with no error. You’ll see why in this course. You pass remind without calling it, as in Python, but the rest of the line can change meaning.

That desk checks climbers in, each with a numbered wristband, and its Learn to Boulder class has two places. Check-in is moving to a JavaScript tablet app, so you’ll port the desk’s script.

By the end of this course, you’ll be able to:

  • Say which variable a name means and when it exists, and read old code that uses var
  • Keep state in closures, and make functions in a loop without workarounds
  • Take any number of arguments, and options you didn’t name
  • Pass callbacks, set timers, and build functions from functions
  • Port the whole front-desk script to JavaScript

You only need to know Python’s scope rules (LEGB and global) and how to write closures with nonlocal, lambdas, functions with *args and **kwargs, callbacks, and functools.partial. In JavaScript, you only need to know how to write functions with default parameters, options objects and arrows, and how to use array methods such as map() and reduce().

A current version of Node.js and of Python is fine: the examples use Node 26 and Python 3.15.

The course mixes short videos and text lessons, with exercises where you write the code yourself. Every video has a summary below it, and a quiz and a summary close the course.

Next up: Reading and Changing Outer Variables, a text lesson that opens on the desk’s shoe hire.

Download

Sample Code (.zip)

8.4 KB
Download

Course Slides (.pdf)

825.2 KB

Become a Member to join the conversation.