Introduction to the $. extend method in jQuery to extend the JSON object, jqueryjson
$. Extend can be used to extend a JSON object. One or more other objects can be used to expand an object and return the extended object.
Example 1
Merge settings and options, modify and return settings
Var settings = {validate: false, limit: 5, name: "foo"}; var options = {validate: true, name: "bar"}; jQuery. extend (settings, options );
ResultSettings = {validate: true, limit: 5, name: "bar "}
Example 2
Merge ults and options without modifying defaults.
Var empty ={}; var defaults = {validate: false, limit: 5, name: "foo"}; var options = {validate: true, name: "bar "}; var settings = jQuery. extend (empty, defaults, options );
Result
Settings = {validate: true, limit: 5, name: "bar "}
Empty = {validate: true, limit: 5, name: "bar "}
The above discussion about the $. extend method in jQuery to expand the JSON object is all the content shared by the editor. I hope you can give us a reference and support for the house of friends.