Getting First and Last Items in Array (and splitting all the rest)
I needed to get the first item from an array lately in JavaScript. Hmmmm … lemme think here. I remember that .pop()
is for snagging the last item from the array, like this:
const arr = ["This", "Little", "Piggy"];
const
…