Skip to content

Instantly share code, notes, and snippets.

@edom18
Created March 4, 2013 09:15
Show Gist options
  • Save edom18/5081008 to your computer and use it in GitHub Desktop.
Save edom18/5081008 to your computer and use it in GitHub Desktop.
Simple copy object properties.
defaults =
param1: 'hoge'
param2: 'fuga'
param3: 'foo'
param4: 'bar'
param5: 'baz'
obj = {}
obj[p] = defaults[p] for p of defaults
console.log obj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment