Created
November 26, 2013 01:36
-
-
Save nola/7652088 to your computer and use it in GitHub Desktop.
The old school way of setting up an array was to create a named array and then add each named element one by one. A quicker and more readable way is to add the elements at the same time using the object literal notation. Please note that Associative Array are essentially JavaScript Objects with properties.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var skillSet = new Array(); | |
| skillSet['Document language'] = 'HTML5'; | |
| skillSet['Styling language'] = 'CSS3'; | |
| skillSet['Javascript library'] = 'jQuery'; | |
| skillSet['Other'] = 'Usability and accessibility'; | |
| //short hand version | |
| var skillSet = { | |
| 'Document language' : 'HTML5', | |
| 'Styling language' : 'CSS3', | |
| 'Javascript library' : 'jQuery', | |
| 'Other' : 'Usability and accessibility' | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment