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:
- Declaring the function with parameters: function name(param) { ... }
- Calling the function with an argument: name(arg)
- Running the statements in the function body
- Returning the result (return) to where the function was called