Skip to content

Instantly share code, notes, and snippets.

@TheNeikos
Created December 31, 2013 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheNeikos/8197609 to your computer and use it in GitHub Desktop.
Save TheNeikos/8197609 to your computer and use it in GitHub Desktop.
A simple way of merging Javascript Objects made of simple types.
simpleDeepMergeObjects = ->
ret = {}
for i, obj of arguments
for k, v of obj
if 'Object' is typeof v
ret[k] = simpleDeepMergeObjects ret[k], v
else
ret[k] = v
return ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment