how to remove last 2 items in js array code example Example: javascript delete second last element of array arr.splice(arr.length - 2, 1);