Skip to content

Instantly share code, notes, and snippets.

@felixzapata
Created November 17, 2012 18:01
Show Gist options
  • Select an option

  • Save felixzapata/4098274 to your computer and use it in GitHub Desktop.

Select an option

Save felixzapata/4098274 to your computer and use it in GitHub Desktop.
how to empty an array in JavaScript
// http://stackoverflow.com/questions/1232040/how-to-empty-an-array-in-javascript
// related: Splicing is the worst by far: http://jsperf.com/emptying-arrays/4
matrix.splice(0,matrix.length);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment