Skip to content

Instantly share code, notes, and snippets.

@nola
Created November 26, 2013 01:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nola/7652078 to your computer and use it in GitHub Desktop.
Save nola/7652078 to your computer and use it in GitHub Desktop.
Useful way of declaring small arrays on one line. Object Array Notation Shorthand
var a = new Array();
a[0] = "myString1";
a[1] = "myString2";
a[2] = "myString3";
//short hand version
var a = ["myString1", "myString2", "myString3"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment