Put in order · JavaScript and TypeScript course · Module 1: JavaScript Basics
Structure of a Code Block in a Function
Arrange the elements of a code block structure in a JavaScript function:
Items to put in order
- }
- return result;
- local variable declarations
- statements (logic)
- function name() {
Show the answer
Correct order:
- function name() {
- local variable declarations
- statements (logic)
- return result;
- }