javascript shift vs unshift code example
Example 1: unshift method in javascript
var name = [ "john" ];
name.unshift( "charlie" );
name.unshift( "joseph", "Jane" );
console.log(name);
//Output will be
[" joseph "," Jane ", " charlie ", " john "]
Example 2: js unshift vs push
//My Opinion is really nothing. They are the same exept one adds a element
//to the end and the other one adds a element to the front
// Push Method
var array = [2];//your random array
array.push(3)
// Unshift Method
array.unshift(1)