Where this matters
This distinction matters in array callbacks: a calculation inside braces can run successfully while the callback still returns undefined.
const first = n => n * 2;
const second = n => { n * 2; };
console.log(first(3));
console.log(second(3));Read the full explanation
An expression arrow returns its expression. A block body needs return; without it, the function returns undefined.
Trace the code
- The first arrow has an expression body, so its expression value becomes the return value.
- The second has a block body. Evaluating multiplication alone does not return it.
- Reaching the end of that function without return produces undefined.
Why the other predictions differ
undefined undefined— The first expression arrow has an implicit return.6 6— The second arithmetic expression is evaluated but never returned.
6 undefined
Reading this explanation does not record mastery. A correct submitted attempt can do so, including after review.
Change one thing
Keep the braces but add an explicit return.
Predict the result, then run this self-contained snippet in your browser’s developer console. It uses only sample values and makes no network requests.
const second = n => { return n * 2; }; console.log(second(3));Check the variation’s output
6
Explain which binding, value, or operation changed before moving to the next challenge.