Skip to content
Justice Tech School

Array Basics

Arrays hold ordered values. Use indexes from 0, length for the size, push and pop at the end, unshift and shift at the start.

Example
const a = [1, 2, 3];
a.push(4); a.unshift(0);
console.log(a, a.length);
console.log(a.pop(), a.shift(), a);

Exercise

Add to the end.

a.(5)

Quiz Test

Which removes the last item?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.