JavaScript Array Methods

Alicia Weenum
2 min readFeb 22, 2021

During my journey, the term iteration would scare me a bit. It’s one of those words where I’d hear it and think I’d understand what it was and then completely forget what it was or how to use it or when to use it.

In the exams below, I have a few of the array methods. They came in the handiest when I needed to take in information from a website(API) that I’d use these array methods to tell them how I wanted to use them in my code. At first, that information is jumbled together and these array methods are meant to access and change the information to my liking.

.filter method

I used this .filter method so I could organize the category items based by their names. Before the .filter method, I’d get a whole list of category names.

.map and .forEach methods

.map here is basically using the data from an array, putting them in a list item and changing the html to the name, price and the category that each item is listed under.

The .forEach method, I’m basically adding those elements to the list on my application.

REPOS:

Frontend: https://github.com/CodeMama96/my-receipt-manager

Backend: https://github.com/CodeMama96/my-receipt-manager-backend

--

--