Skip to content
JS Fundamentals: Objects, Arrays, and Functions
Share
Explore
Functions

icon picker
Exercise: Implement callLater

Prompt

Implement , callLater that returns a function that can be called later up to three times, with three arguments.
Definition: callLater(callback)
Example Usage:
function displayWinningGuess(suspect, weapon, room) {
console.log(`It was ${suspect} in the ${room} with a ${weapon}`);
};

const guessSuspect = callLater(displayWinningGuess);

const guessWeapon = guessSuspect('??');

const guessRoom = guessWeapon('??');

const winningGuess = guessRoom('??');

Code here

Loading…

Solution

The solution is in the solution branch, which can be checked out in the by selecting the version control tab on the right and then selecting the solution branch from the drop down menu.
If you are having trouble with the solutions are also available below.

callLater Solution


Next 👉


©2021 for


Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.