Skip to content

Instantly share code, notes, and snippets.

@gonghao
Created December 28, 2012 14:55
Show Gist options
  • Save gonghao/4398487 to your computer and use it in GitHub Desktop.
Save gonghao/4398487 to your computer and use it in GitHub Desktop.
Empty an Array with JavaScript
myArray = []; // bad
myArray.length = 0; // good!
@gonghao
Copy link
Author

gonghao commented Dec 28, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment