Call It explainer


#1

The aim of this puzzle: Complete the leaveMessage() function so that it makes a call and then leaves a message.

Walkthrough of the solution: There are 2 separate function declarations: makeCall() and leaveMessage(). Each one simply writes a string to the console.

The goal is to make the leaveMessage() function do 2 things: 1st run the makeCall() function, and then do the Leaving message. output.

Add makeCall() as the 1st line of the leaveMessage() function definition, right above the console.log(...).

Sample code solution:
(Tap below to reveal)

function makeCall() {
  console.log('Calling...');
}

function leaveMessage() {
  makeCall();
  console.log('Leaving message.');
}

leaveMessage();

JavaScript Concepts: Function Declarations, Function Calls, console.log(), Variable Declaration (let)