Ways to Empty an Array in JavaScript and the Consequences