How do I empty an array in JavaScript?
Ways to clear an existing array A: Method 1 (this was my original answer to the question) This code will set the variable A to a new empty array. This is perfect if you don’t have references to the original array A anywhere else because this actually creates a brand new (empty) array. You should be careful with this method because … Read more