Loading video player…

Welcome to the Booking Confirmations

Welcome to Porting Python’s Defaults and match Statements to JavaScript. You’ll move Nadia’s community-center booking confirmations from Python to JavaScript. A line-by-line port can run successfully and still produce a different confirmation, as Sam Ortiz’s request from last month shows.

By the end, you’ll be able to:

  • Pick values and choose defaults for booking data.
  • Fill in requests.
  • Port guarded and patterned decisions from Python’s match.
  • Call available notice functions.
  • Port the booking confirmations script.

You should know Python’s or, and, conditional expressions, and match. You should be able to write small JavaScript programs with objects, Maps, arrays of objects, and arrow functions. You should also know ??, ?., else if, the conditional operator, and switch.

Use a current Node installation. The examples use Node 26 and Python 3.15.

Short videos mix with text lessons and exercises. Every video has a summary below it. A quiz and a summary close the course.

Next up: Picking a Value With || and &&, starting from Nadia’s booking form.

Download

Sample Code (.zip)

8.6 KB
Download

Course Slides (.pdf)

499.4 KB

00:00 Welcome to Porting Python’s Defaults and match Statements to JavaScript. You’ll explore defaults and decisions. You’ll port the booking confirmations that Nadia, bookings coordinator at the Millbrook Community Center, sends for its hall, studio and kitchen.

00:17 Last month, Sam Ortiz requested four hours without ticking a room. Here are the room-selection lines.

00:36 Python prints hall and one hundred twenty dollars.

00:41 The JavaScript port prints no room and zero dollars. It runs without an error. Each Sunday, Nadia confirms the center’s bookings: rooms, charges, deposits, caretakers, and notices.

00:57 You’ll make the JavaScript back end preserve those decisions.

01:01 You’ll pick values and choose defaults, fill in requests, and port guarded and patterned decisions. You’ll call available notice functions, then port the confirmation script.

01:13 Each step starts from Python you know and builds toward JavaScript you can write. You should know Python’s or, and, conditional expressions, and match statements.

01:24 You should write small JavaScript programs with objects, Maps, arrays of objects, and arrow functions. You should know ??, ?., else if, the conditional operator, and switch for decisions.

01:39 Use a current Node installation; the examples use Node 26 and Python 3.15. Short videos mix with text lessons and exercises. Every video has a summary below it.

01:54 A quiz and summary close the course. Next up: Picking a Value With || and &&. You’ll start with Nadia’s booking form.

Become a Member to join the conversation.