WeCodeAcademy

Arrays and Array Methods

Arrays have handy methods. push adds, map transforms every item, filter keeps some.

Examplejavascript
Open in editor »
Quick check

Which method creates a new array with only the items that pass a test?

Your turn: write the code

Add "cherry" to the end of fruits, then print how many items it has.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.