JavaScript · Junior · Question 68 of 75

What does a function return if it has no return statement?

Explanation

Only arrow functions with a concise body (x => x * 2) return the expression implicitly. A block body x => { x * 2 } returns undefined.

Further reading

Problem with a question

JavaScript · Junior · question 68

Test yourself

Take the JavaScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz