January 2020
Intermediate to advanced
470 pages
11h 13m
English
In the lambda coding style, functions only consist of a result. For the sake of brevity, the new arrow functions provide a syntax for this. When you write something like (x,y,z) => followed by an expression, a return is implied. For instance, the following two functions actually do the same as the sum3() function that we showed previously:
const f1 = (x, y, z) => x + y + z;const f2 = (x, y, z) => { return x + y + z;};
If you want to return an object, then you must use parentheses; otherwise, JavaScript will assume that code follows.
Read now
Unlock full access