Put in order · JavaScript and TypeScript course · Module 1: JavaScript Basics

Stages of Defining and Calling Functions

Arrange the stages of defining and calling functions in JavaScript:

Items to put in order

  • Running the statements in the function body
  • Declaring the function with parameters: function name(param) { ... }
  • Calling the function with an argument: name(arg)
  • Returning the result (return) to where the function was called
Show the answer

Correct order:

  1. Declaring the function with parameters: function name(param) { ... }
  2. Calling the function with an argument: name(arg)
  3. Running the statements in the function body
  4. Returning the result (return) to where the function was called