Fundamentals8 / 12
Up next

Arrow functions

// a single-expression arrow returns that expression
const square = (n) => n * n;
const nums = [1, 2, 3, 4];
const evens = nums.filter((n) => n % 2 === 0);
console.log(square(5), evens);
What you're solving

concise callbacks with implicit return