Arrow functions

const fn = (x) => ...

const fn = (x) => x * x is a short function. One expression returns implicitly.

Goal

Square units with an arrow function.

const square = (n) => n * n;
console.log(square(12));
const greet = (city) => `Kiosk in ${city}`;
console.log(greet("Mombasa"));
const add = (a, b) => a + b;
console.log(add(8, 5));
const cities = ["Nairobi", "Kisumu"];
const labels = cities.map((c) => c.toUpperCase());
console.log(labels);