Given that the length of the array was already set to 0, why does pop
set it to zero again?
Here are the first three steps of the ECMAScript 2023 spec for pop
:
1. Let O be ? ToObject(this value).
2. Let len be ? LengthOfArrayLike(O).
3. If len = 0, then
a. Perform ? Set(O, "length", 0