Skip to content

Instantly share code, notes, and snippets.

@jswhisperer
Created January 4, 2014 18:26
Show Gist options
  • Save jswhisperer/8258647 to your computer and use it in GitHub Desktop.
Save jswhisperer/8258647 to your computer and use it in GitHub Desktop.
Truncate an array using length
var myArray = [12 , 222 , 1000 , 124 , 98 , 10 ];
myArray.length = 4; // myArray will be equal to [12 , 222 , 1000 , 124]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment