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

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

You can't request more than 20 challenges without solving them. Your previous challenges were flushed.

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"