🔍 Learn JavaScript Array Methods

Visualize how each array method works before diving into the game! Click the buttons to see the transformations.

1. push()

Adds an element to the end of the array.

arr.push(99)

2. splice()

Removes elements from specific index.

arr.splice(1, 1)

3. reverse()

Reverses the array in place.

arr.reverse()

4. sort()

Sorts the array numerically.

arr.sort((a, b) => a - b)

5. filter()

Keeps only even numbers.

arr.filter(n => n % 2 === 0)