Skip to content

Instantly share code, notes, and snippets.

@mhairston
Created January 28, 2016 21:57
Show Gist options
  • Save mhairston/13285575079479184681 to your computer and use it in GitHub Desktop.
Save mhairston/13285575079479184681 to your computer and use it in GitHub Desktop.
Merging Objects with jQuery
// Merging objects via jQuery
var defaults = { validate: false, limit: 5, name: "foo" };
var options = { validate: true, name: "bar" };
// merged objects not modified -- creates new object `settings`
var settings = $.extend( {}, defaults, options );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment