This course shows you how JavaScript writes functions: what a function hands back, how its parameters get defaults, small functions written as arrows, functions passed around as values, and named options where Python has keyword arguments.
Your project is a freelance translator’s Python quote script, and you’ll port it to JavaScript.
Here’s a first taste. In Python, her quote() function hands back two results, the fee and the
turnaround, for a 6,200-word contract:
(744.0, 5)
Ported line for line to JavaScript, with return fee, days;, the function runs without an error and
logs one number, the turnaround:
5
The fee is gone. This course shows you where it went, and the other spots where a ported function gives a different answer instead of an error.
The translator gets about ten quote requests a day. Her Python script prices each one with the same rules: a per-word rate, a minimum fee, a rush surcharge, and a turnaround in working days. Her new quote form runs on JavaScript, so you’ll port her functions.
By the end of this course, you’ll be able to:
- Return early from a function, and return two results
- Give parameters defaults
- Know what an arrow function returns, and pass functions around
- Take named options where Python uses keyword arguments
- Port the whole quote script to JavaScript
You only need to know how to write Python functions with def, default arguments, keyword
arguments, and return. In JavaScript, you only need to know how to write a small program with
const, if, basic functions and arrows, objects, the conditional operator, and array destructuring.
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. A project puts the quote script together, and a quiz and a summary close the course.
Next up: Returning Early From a Function, a text lesson.