
array.unshift() – Adds one or more elements to the **beginning** of an array and returns the new length.
๐ Syntax
newLength = array.unshift(element1, ...);
๐งช Example
const arr=[2,3]; arr.unshift(1); // [1,2,3]

array.unshift() – Adds one or more elements to the **beginning** of an array and returns the new length.
newLength = array.unshift(element1, ...);
const arr=[2,3]; arr.unshift(1); // [1,2,3]
Comments
Post a Comment