Skip to content

Instantly share code, notes, and snippets.

@rogerbuecker-snippets
Created October 12, 2012 11:25
Show Gist options
  • Save rogerbuecker-snippets/3878771 to your computer and use it in GitHub Desktop.
Save rogerbuecker-snippets/3878771 to your computer and use it in GitHub Desktop.
JavaScript: Empty an Array
var myArray = ["one", "two", "three"];
// console.log( myArray ) => ["one", "two", "three"]
myArray.length = 0;
// console.log( myArray ) => []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment