Explicit Return
suggest changeAn arrow function with a brace body returns only what you return, like a classic function. Without braces, the expression itself is the return value.
const foo = x => {
return x + 1;
}
foo(1); // -> 2
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents