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.