If you have used JQuery's extension function, you must know something about it.
However, the deep copy of extend is not perfect. Here is an example to analyze with the JQuery source code:
When using extension, if the first parameter passes in true, it means a "deep copy" is required.But this is an incomplete deep copy, as shown in the following example:
As a general understanding of deep copy, the result output should be 1, but the actual result is 2
Let's take a look at the JQuery source code and see:
See the commentary version source for the jquery.extension function (version 1.7)
JQuery source code:
Copyright belongs to the author.For commercial reprinting, please contact the author for authorization. For non-commercial reprinting, please indicate the source.