Skip to content

Instantly share code, notes, and snippets.

@sevperez
Created July 8, 2018 21:36
Show Gist options
  • Save sevperez/b92a0ebce7e396672ea6d04c815c7e56 to your computer and use it in GitHub Desktop.
Save sevperez/b92a0ebce7e396672ea6d04c815c7e56 to your computer and use it in GitHub Desktop.
var products = {
"widget": 400,
"gear": 80,
"crank": 375,
"lever": 870,
};
var otherProducts = Object.create(products);
otherProducts["wheel"] = 210;
for (var product in otherProducts) {
console.log(product + " : " + otherProducts[product]);
}
// logs "wheel: 210", widget : 400", "crank : 375", "lever : 870"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment