Let’s Talk about Higher-Order Functions Pt. 2

.reduce()

Definition + Syntax — MDN

When to Use:

reduce() allows us to loop over values in an array and return a single output. At its most basic use, you can sum an array of numbers. You can also use other methods inside the reduce like conditional statements or other applicatives.

In Action:

A simple .reduce() used in A Very Big Sum on HackerRank.

.includes()

Definition + Syntax — MDN

When to Use:

includes()

In Action:

Full stack web developer. Frontend and design enthusiast. Avid rock climber and amateur photographer.