0 of 6 problems solved • 0%
Use in a course

Arrow Functions

6 exercisesEasy

Arrow functions are a compact way to write function values. A single expression can be returned implicitly; a block body needs an explicit return when it should produce a result.

const double = (number) => number * 2; const describeScore = (score) => { const doubled = double(score); return `Double score: ${doubled}`; }; console.log(describeScore(6)); // Double score: 12

Familiar function declarations become arrow functions as you practise both body styles. This syntax appears frequently in callbacks, which makes fluency here useful for the array modules ahead.