JavaScript · Junior · Question 68 of 75
What does a function return if it has no return statement?
- ✓Correct answer:
undefined - 2
null - 3The value of its last expression
Explanation
Only arrow functions with a concise body (x => x * 2) return the expression implicitly. A block body x => { x * 2 } returns undefined.