Array.prototype.popintermediateconst arr = ['a', 'b', 'c']
arr.pop()
console.log(arr) // β ['a', 'b'] (mutated!)pop() mutates the original array β if you need immutability, use slice(0, -1) instead.
pop() is a mutating method: it changes the original array. After popping, the array has one fewer element. This exercise focuses on observing that side-effect.
Challenge: Implement popAndCheck(arr) that pops from arr and returns the mutated array (not the popped value).
popAndCheck([1, 2, 3]) // β [1, 2]
popAndCheck([10]) // β []