Skip to content

Instantly share code, notes, and snippets.

@heldr
Created April 14, 2016 21:55
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 heldr/fe5ca85652d64136a2e774a7a073c7da to your computer and use it in GitHub Desktop.
Save heldr/fe5ca85652d64136a2e774a7a073c7da to your computer and use it in GitHub Desktop.
Assign, extend and merge
Object.assign({}, { a: 1, b: undefined })
Object {a: 1, b: undefined}
jQuery.extend({}, { a: 1, b: undefined })
Object {a: 1}
// lodash
_.extend({}, { a: 1, b: undefined })
Object {a: 1, b: undefined}
_.merge({}, { a: 1, b: undefined })
Object {a: 1}
_.assign({}, { a: 1, b: undefined })
Object {a: 1, b: undefined}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment