Skip to content

Instantly share code, notes, and snippets.

@JasonDeving
Created March 14, 2016 23:50
Show Gist options
  • Save JasonDeving/558e9643c43324a37062 to your computer and use it in GitHub Desktop.
Save JasonDeving/558e9643c43324a37062 to your computer and use it in GitHub Desktop.
objects
var animal = {};
animal.username = 'Mittens';
animal['tagline'] = 'pet me';
var noises = [];
animal.noises = noises;
var count = 0;
for(var key in animal) {
count++;
if (key === 'username') {
console.log('hi my name is ' + animal[key]);
} else if (key === 'tagline') {
console.log('I like to say ' + animal[key]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment