Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript unshift

 let array = ["A", "B"];
 let variable = "what you want to add";

//Add the variable to the beginning of the array
 array.unshift(variable);

//===========================
 console.log(array);
//output =>
//["what you want to add" ,"A", "B"]
 
PREVIOUS NEXT
Tagged: #javascript #unshift
ADD COMMENT
Topic
Name
1+7 =