Using Flot.js to use the Extend method of jquery
About the Extend method I'll go through the manual, deepen my understanding, and honestly I don't understand.
Extend extends an object with one or more other objects, returning the object being extended.
If you do not specify target, the jquery namespace itself is extended, which helps plug-in authors add new methods as jquery. If the first argument is set to True, jquery returns a deep copy, recursively copying the found object. Otherwise, the copy will share the structure with the original object. Undefined properties will not be copied, and properties inherited from the object's prototype will be copied.
Parameters
Target, "Object1", "objectn"
Target: An object, if the attached object is passed to this method then it will receive the new attribute if he is the only parameter that will extend the namespace of jquery.
Object1: The object to be merged into the first object
OBJECTN: An object to be merged into Nth object
"Deep", target,object1,objectn
Deep: If set to True, the merge is recursive.
Target: object to be modified
Object1: The object to be merged into the first object
Example
Merge settings and options, modify and return settings.
var settings = {validate:false,limit:5,name: ' foo '}
var options = {validate:true,name: "Bar"}
$.extend (settings,options);
Results:
Settings = = {validate:true,limit:5,name: "Bar"}
Merge default and options, and return to Settings
var empty ={};
var default= {validate:false,limit:5,name: "foo"};
var options = {validate:validate:true,name: "Bar"};
var settings = $.extend (empty,default,options);
Results:
Settings ={validate:true,limit:5,name: "Bar"};
Empty = {validate:true,limit:5,name: "Bar"}
The Extend method of jquery