Array.prototype.popintermediateconst words = ['foo', 'bar', 'baz']
const last = words.pop() // β 'baz'
words // β ['foo', 'bar']Use pop() to consume the last string element from a queue or word list.
pop() works on any typed array, not just numbers. This exercise applies it to a string array to remove and return the last word in a list.
Challenge: Implement removeLastWord(words) that pops and returns the last string from the array.
removeLastWord(['hello', 'world']) // β 'world'
removeLastWord(['only']) // β 'only'