

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Objects
incomplete
2: No Colon
incomplete
3: Updating Properties
incomplete
4: Nesting Properties
incomplete
5: Nesting Properties Quiz
incomplete
6: Optional Chaining
incomplete
7: When to Chain
incomplete
8: Object Methods
incomplete
9: Methods Mutate
incomplete
10: Initializing Props
incomplete
11: Strings As Keys
incomplete
12: This
incomplete
13: Arrow Functions
incomplete
14: Fat Arrows and This
incomplete
15: Spread Syntax
incomplete
16: Return Objects
incomplete
17: Destructuring
incomplete
18: Not Bound
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Fat arrow functions, or "arrow functions" are another way to define functions in JavaScript. Arrow functions are newer than the function keyword, however, unlike the let/const syntax, arrow functions are sometimes better, not always better.
// declaring a function without a variable
function add(x, y) {
return x + y;
}
// declaring a function with a variable
const add = function (x, y) {
return x + y;
};
// using the fat arrow syntax
const add = (x, y) => {
return x + y;
};
It's so cool and not confusing at all that there are 3 ways to do (basically) the same thing...
function keyword may or may not be declared as a variable.You just got a new zoomer boss at Textio that thinks fat arrow functions are the best thing since Mr. Beast's last video. He's forcing the team to convert all the classic functions to fat arrow functions.
Convert isSpamMessage to the fat arrow function syntax, but don't change its internal behavior.