Your files never leave your device
Advertisement

Functions

Functions are reusable blocks of code. You define them once, and can "call" them many times with different inputs.

Function Declarations

A basic function takes inputs (parameters), does something, and returns an output.

Try It Yourself

        

Arrow Functions

Introduced in ES6, arrow functions provide a shorter syntax and are commonly used for passing functions as arguments.

Try It Yourself

        

Practice

Challenge 1: Write a function isEven that takes a number and returns true if it's even, false otherwise.

Related Guides

Sponsored Utility
While You're Here
Sponsored Recommendations
Advertisement