$.extend (DES,SRC,SRC2);
The API documentation is written so, but when SRC,SRC is not a string, the result is that each character of the string is split separately and placed on des
var ext = {name:111} $.extend (ext,{age:999}) Console.log (EXT)
==>object {
When SRC is not an object
1 varext = {name:111}2$.extend (ext, "What's the situation!!! "I'll Go!" ")
===>object { 0: "I", 1: " Go ", 2: "! ", 3: " what ", 4: ", 5: "Love", 6: 7: " ah ", 8: "! ", 9: "! ", 10: "! ", name: 111}
Test to this, suddenly think of the order of extend, it seems that the right side of the tree is covered by the same property values on the left side of the object, see the result of the traversal is not like this, but first from the right side, if the left side has the same property is not
Read the value of it.
1 var ext = {name:111}2 $.extend (ext,{aa:11,tt:33},{aa:22}, "I go! ")3 console.log (EXT)
==>Object {