In the code above, we:
- We then logged that array to the browser’s console so that we could view it’s structure.
- Then, we overwrote the original array with a new blank array.
- Finally, we logged it to the developer console again.
If you run the code above and look at your browser’s developer console, you should see something similar to this:
Note that this is both the fastest and easiest solution to this problem.