js push item to first position in array code example
Example 1: javascript array insert at 0
let myArray = [1,2,3];
myArray.unshift(0);
console.log(myArray); // [0,1,2,3]
Example 2: js add element to front of array
//Add element to front of array
var numbers = ["2", "3", "4", "5"];
numbers.unshift("1");
//Result - numbers: ["1", "2", "3", "4", "5"]