
array.shift() – Removes the **first element** from an array and returns that element.
๐ Syntax
element = array.shift();
๐งช Example
const q=['first','second']; q.shift(); // 'first'
array.shift() – Removes the **first element** from an array and returns that element.
element = array.shift();
const q=['first','second']; q.shift(); // 'first'
Comments
Post a Comment