Learning

Dan Shiffman Coding Train videos

Playlist: p5.js Tutorial

Playlist: Array Functions in JavaScript (from Topics of JavaScript/ES6)

Reference

MDN Web Docs: Arrays describes the Array type, and documents and has examples for each of the Array methods.

The JS Cheat Sheet has a module on Arrays:

From the JS Cheat Sheet.

From the JS Cheat Sheet.

Array Methods

Sarah Drasner's JavaScript Array Explorer allows you to choose the operation, and see the code (the Array method) that does this.

JavaScript Array Explorer

JavaScript Array Explorer

Table: Reading, Inserting, Removing, and Replacing Elements

Read

Insert

Remove

Replace

First Element

array[0]

array.unshift('a')

array.shift()

array[0] = 'A'

Middle

array.slice(2, 3)

array.splice(2, 0, 'c', 'd', 'e')

array.splice(2, 3)

array.splice(2, 3, 'C', 'D', 'E')

Last Element

array[array.length - 1]

array.push('z')

array.pop()

array[array.length-1] = 'Z'

More

JavaScript Iteration Methods compares array.map(), array.forEach(), array.some(), and array.every() to the same functionality written using for loops.

Tutorials

Array Ellipsis Shortcuts