Answers for "javascript add item to array first position"

3

javascript push to first index

var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.unshift("Lemon","Pineapple");
Posted by: Guest on May-26-2021
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
10

unshift method in javascript

var name = [ "john" ];
name.unshift( "charlie" );
name.unshift( "joseph", "Jane" );
console.log(name);

//Output will be
[" joseph "," Jane ", " charlie ", " john "]
Posted by: Guest on August-02-2020

Code answers related to "javascript add item to array first position"

Code answers related to "Javascript"

Browse Popular Code Answers by Language