#How to `Array.shift()` but create new array instead of mutate existing one?

3 messages · Page 1 of 1 (latest)

gusty hill
#

n/t

hasty rain
#

you could use destructuring assignment:

const [first, ...rest] = yourArray
gusty hill
#

Yeah, that's a good solution, thank you.