programming faqs interview questions tech technical educational freshers guide preparation interviews hr telephonic
try another color:
try another fontsize: 60% 70% 80% 90%
ProgrammingFAQs

How to add new elements to the beginning of array in javascript

using unshift() method we

using unshift() method we can add new element to the beginning of an array, and it returns the new
length of the array

var skills = ["javacript", "jquery", "Extjs"];
skills.unshift("php")

o/p array: php, javascript, jquery, extjs
and it returns the length as "4"