MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/onix79/javascript_function_facts/h5ucdx4/?context=3
r/learnjavascript • u/hsnice • Jul 19 '21
27 comments sorted by
View all comments
4
The first fact has an omitted exception: arrow functions. An arrow function without a return statement or curly braces will return the result of the evaluated inline statement.
For example:
const myFunc = (x) => x+2; console.log(myFunc(1)); // 3
4
u/[deleted] Jul 20 '21
The first fact has an omitted exception: arrow functions. An arrow function without a return statement or curly braces will return the result of the evaluated inline statement.
For example: