6 Array Methods to Simplify Your JavaScript

The lowdown on filter, find, map, reduce, every, and some

Aphinya Dechalert
Modules&Methods
Published in
5 min readAug 30, 2019

--

Image composed by Aphinya Dechalert. Titled: space monkey contemplating the cosmic puzzle known as JavaScript

Not everything is an object. When it comes to functional programming, it’s more to do with the processes that get you from point A to point B than how data and groups of business logic are structured.

JavaScript is a language that’s prone to imperative patterns because of how easy it is to pick up. A lot of developers tend to write their code in a procedural manner — where one blip in the procedure can break the code or create side-effect bugs.

This is where functional patterns come in.

The Quick Lowdown on Functional Programming

A lot of smelly JavaScript code is written in an imperative or procedural pattern. This is code that’s written in a way that represents a flow of thought, resulting in a series of dependencies for the chain to work.

Take a look at the procedural model below:

Start.Check computer power status
if on, proceed to next step. Else proceed to turn computer on.
Enter password. If password accepted, proceed. Else try again.
Open browser.
Start browsing the Internet.
End.

--

--

Aphinya Dechalert
Modules&Methods

Where Development Meets Storytelling: Tech Writer, Editor & Dev Advocate. Translating Complexity into Clarity. DM me. linkedin.com/in/dechalert