const arr = [1, 2, 3, 4]

let len = arr.unshift(10)
console.log(arr) // [10,1,2,3,4]
console.log(len) // 5

let len2 = arr.unshift(20, 50)
console.log(arr) // [20,50,10,1,2,3,4]
console.log(len2) // 7


//2つの配列をマージする
let arr1 = ['red','blue','yellow'];
let arr2 = ['white','black'];

let len3 = Array.prototype.unshift.apply(arr1, arr2);

console.log(arr1); //["white","black","red","blue","yellow"]
console.log(len3); // 5

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.