Skip to content

Instantly share code, notes, and snippets.

@sarfraznawaz2005
Last active October 12, 2015 18:31
Show Gist options
  • Save sarfraznawaz2005/982dba5889cbd891ec41 to your computer and use it in GitHub Desktop.
Save sarfraznawaz2005/982dba5889cbd891ec41 to your computer and use it in GitHub Desktop.
Using length to truncate arrary
var foo = [1, 2, 3, 4, 5, 6];
foo.length = 3;
foo; // [1, 2, 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment