Answers for "array add start of the index js"

56

js push to start of array

var colors = ["white","blue"];
colors.unshift("red"); //add red to beginning of colors
// colors = ["red","white","blue"]
Posted by: Guest on July-23-2019
1

insert data at first position in array javascript

const fruits = ["Banana", "Orange", "Apple", "Mango"];

fruits.unshift("Lemon","Pineapple");
Posted by: Guest on July-24-2021

Code answers related to "array add start of the index js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language