Manipulate data in an array / manipulate arrays

PHOTO EMBED

Thu Nov 11 2021 16:42:30 GMT+0000 (Coordinated Universal Time)

Saved by @KarenStewart #javascript #react.js

const array = [1, 2, 3, 4]

//remove the first element of the array
array.shift()

//add an element to the beginning of the array
array.unshift()

//remove the last element in an array
array.pop()

//add an element to the end of the array
array.push()
content_copyCOPY