for-in
loops should include an if
statement JS-00513544 (e._getDelegateConfig = function () {
3545 var t = {};
3546 if (this.config)
3547 for (var e in this.config)3548 this.constructor.Default[e] !== this.config[e] &&3549 (t[e] = this.config[e]);3550 return t;
3551 }),
3552 (e._cleanTipClass = function () {
1246 function (t) {
1247 for (var e = 1; e < arguments.length; e++) {
1248 var n = arguments[e];
1249 for (var i in n)1250 Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);1251 }
1252 return t;
1253 };
39 function (t) {
40 for (var e = 1; e < arguments.length; e++) {
41 var n = arguments[e];
42 for (var i in n) 43 Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]); 44 }
45 return t;
46 }).apply(this, arguments);
845 }
846 function D(e) {
847 let t = "";
848 for (let n in e) t += e[n]; 849 return t;
850 }
851 function P() {
24 function (s) {
25 for (var e, n, t = 1; t < arguments.length; t++) {
26 e = arguments[t];
27 for (n in e) 28 Object.prototype.hasOwnProperty.call(e, n) && (s[n] = e[n]); 29 }
30 return s;
31 },
Looping over objects with a for in
loop will include properties that are inherited through the prototype chain.
This behavior can lead to unexpected keys in your for loop.
for (const key in foo) {
doSomething(key);
}
for (const key in foo) {
if (Object.prototype.hasOwnProperty.call(foo, key)) {
doSomething(key);
}
}
for (const key of Object.keys(foo)) {
doSomething(key);
}