0
0
Javascriptprogramming~5 mins

Function execution flow in Javascript - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What happens first when a JavaScript function is called?
The function's code starts running from the first line inside the function block.
Click to reveal answer
beginner
What is the role of the return statement in a function?
It stops the function and sends a value back to where the function was called.
Click to reveal answer
beginner
What happens if a function does not have a return statement?
The function returns undefined by default after finishing all its code.
Click to reveal answer
intermediate
How does JavaScript handle multiple function calls in a row?
Each function runs completely before the next one starts, following the order they were called.
Click to reveal answer
intermediate
What is the call stack in JavaScript function execution?
It is a structure that keeps track of all the functions that are currently running or waiting to finish.
Click to reveal answer
What does the return statement do inside a function?
ADeclares a variable
BStarts the function
CCalls another function
DStops the function and sends a value back
If a function has no return, what is its result when called?
AIt returns <code>undefined</code>
BIt returns <code>null</code>
CIt throws an error
DIt returns <code>0</code>
What order do functions run if called one after another?
AEach runs completely before the next starts
BLast called runs first
CAll run at the same time
DThey run randomly
What is the call stack used for in function execution?
ATo store variables
BTo keep track of running functions
CTo manage browser tabs
DTo save files
When a function is called, where does execution start?
AAt the middle of the function
BAt the last line of the function
CAt the first line inside the function
DAt the return statement
Explain the flow of execution when a JavaScript function is called.
Think about what happens inside the function and what happens after it finishes.
You got /5 concepts.
    Describe what the call stack is and how it relates to function execution flow.
    Imagine a stack of plates where you add and remove plates in order.
    You got /4 concepts.