Functions You Can Pass Around

Stephen Gruppetta 20 Lessons 5h 27m Updated intermediate js

Tomás and his friends share a watchlist of films, and every movie night starts the same way. Someone opens the list, someone else says the film is too long, and half an hour goes by before anyone presses play. Tomás wants a program that settles the routine questions before the friends arrive. In this course, you’ll build it.

In JavaScript, a function is a value, like a number or a string. You can store it, pass it, and hand it to another function to call later. Once that clicks, you can hand small functions to array methods instead of writing a loop for every question. You’ll learn how to:

  • Store functions in variables, write them as arrow functions, and pass them to other functions.
  • Give parameters default values, and predict when a default fills in and when it doesn’t.
  • Keep an array up to date with push(), pop(), shift(), and unshift(), and build records with shorthand properties.
  • Transform and filter a list of records with map() and filter(), and choose between a chain, forEach(), and a plain loop.
  • Sort numbers and records with comparators, including a second key for ties.
  • Search and check a list with find(), findIndex(), some(), and every().

Each section mixes text lessons and short videos, and ends with an exercise you write in the browser, where automated tests check your code.

In the project, you build Tomás’s movie-night picker. It drops the films over a time limit, lists the titles nobody has seen, finds the first comedy that fits, checks that every film has a vote, and prints a shortlist sorted by votes and then by length. Then you explain to the AI mentor what each callback receives and returns, and take a quiz.

This course is for programmers who can write basic programs in Node, with values, strings, decisions, functions, and loops, and who can work with arrays, objects, and lists of records. If you’ve finished JS Basics or the equivalent, you’re ready. You’ll need a current Node LTS, a terminal, and any editor.

What’s Included:

  • 20 Lessons
  • Video Subtitles and Full Transcripts
  • Translated Subtitles in 8 Languages
  • 2 Downloadable Resources
  • Interactive Quiz to Check Your Progress
  • 5 Hands-On Coding Exercises
  • Q&A With JavaScript Experts: Ask a Question
  • Certificate of Completion

Downloadable Resources:

Related Learning Paths:

About Stephen Gruppetta

Stephen obtained a PhD in physics and worked as a physicist in academia for over a decade before becoming a programming educator. He's constantly looking for simple ways to explain complex things.

» More about Stephen

Each tutorial at RealJS is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:

← Browse All Courses