Answers for "what is unshift in array"

0

how to use unshift() and shift()

//to add the first item to a array 

let top_salespeople = ['Lucy', 'Graham', 'Carol', 'Ann'];
top_salespeople.unshift('Hannah');

console.log(top_salespeople);
Posted by: Guest on August-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language