Array Test Bed
Original Array
items = ['shoes', 'socks', 'belt', 'hat'];
Run It
Splice
items.splice(2,1,'coat','scarf');
Run It
Push
items.push('umbrella','shirt');
Run It
Unshift
items.unshift('tie','pants');
Run It
Shift
items.shift();
Run It
Pop
items.pop();
Run It
Slice
items.slice(1,2);
Run It
Reverse
items.reverse();
Run It
Join
items.join(':');
Run It
Results
items[] contents at start:
JavaScript code:
items[] contents after JavaScript:
Returned value:
Explanation:
blah
blah