Skip to content

Instantly share code, notes, and snippets.

@mikebaldry
Created February 17, 2012 15:35
Show Gist options
  • Select an option

  • Save mikebaldry/1854050 to your computer and use it in GitHub Desktop.

Select an option

Save mikebaldry/1854050 to your computer and use it in GitHub Desktop.
merging 2 objects
mergeObjects: (obj1, obj2) ->
obj3 = {}
for attrName in obj1
obj3[attrName] = obj1[attrName]
for attrName in obj2
obj3[attrName] = obj2[attrName]
obj3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment