Skip to content

Day 1: Arrays - Creation & Basic Mutation

Create ordered collections with arrays and add/remove items using mutation methods.

const skills = ['HTML', 'CSS'];
skills.push('JavaScript'); // adds to end
skills.unshift('Git'); // adds to start
const last = skills.pop(); // removes from end
const first = skills.shift(); // removes from start
console.log(skills); // ['HTML', 'CSS']
console.log(skills.length); // 2
  1. Create a playlist array and manipulate songs using push, pop, shift, and unshift.