أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
Adds new elements to the beginning of an array, and returns the new length
Add new items to the beginning of an array
example
{
var fruits = ["Banana", "Orange", "Apple", "Mango"];fruits.unshift("Lemon","Pineapple");
}
The unshift() method adds new items to the beginning of an array, and returns the new length.
This method changes the length of an array.
To add new items at the end of an array, use the push() method.