Questions about the source code of $.extend in jQuery


if ( target === copy ) {
    continue;
}
What does this sentence prevent? It doesn"t seem to work. Can you give me an example of
?

var x = {}
var y = {}
x.i = y
y.i = x

var c = $.extend(true,x)
console.log(c);

this will directly report an error

Mar.09,2021

reports call stack overflow.

Menu