Tuesday, October 18, 2022

Remove first element from an array

Use slice(start, end) method:

const arr = ['a', 'b', 'c'];
const withoutFirst = arr.slice(1);

https://bobbyhadz.com/blog/javascript-remove-first-element-from-array

No comments:

Post a Comment