Created
January 28, 2016 21:57
-
-
Save mhairston/13285575079479184681 to your computer and use it in GitHub Desktop.
Merging Objects with jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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