const PI = 3.14159
const circleArea = r => PI * r * r
circleArea(5) // β 78.53975
circleArea(10) // β 314.159Arrow functions close over const variables in the surrounding scope, making constants immediately available without passing them as arguments.
A closure can capture variables declared with const, creating a lasting reference.
Challenge: Declare a const variable and create a function that returns it. Call the function and verify it returns the correct value.
Example:
const x = 10
const getX = () => x
getX() // 10