More Array Methods

PHOTO EMBED

Fri Oct 01 2021 11:44:02 GMT+0000 (Coordinated Universal Time)

Saved by @ianvalentino #javascript #method

const groceryList = ['orange juice', 'bananas', 'coffee beans', 'brown rice', 'pasta', 'coconut oil', 'plantains'];

groceryList.shift();
console.log(groceryList);

groceryList.unshift('popcorn');
console.log(groceryList);

console.log(groceryList.slice(1,4));

console.log(groceryList);
content_copyCOPY

.join(), .slice(), .splice(), .shift(), .unshift(), and .concat() amongst many others.

https://www.codecademy.com/courses/introduction-to-javascript/lessons/arrays/exercises/more-array-methods