willtheorangeguy / willtheorangeguy.github.io

Prefer that for-in loops should include an if statement JS-0051
Anti-pattern
Minor
5 months ago6 months old
Wrap the body of a for-in loop in an if statement with a hasOwnProperty guard
3544        (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 () {
Wrap the body of a for-in loop in an if statement with a hasOwnProperty guard
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      };
Wrap the body of a for-in loop in an if statement with a hasOwnProperty guard
  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);
Wrap the body of a for-in loop in an if statement with a hasOwnProperty guard
 845    }
 846    function D(e) {
 847      let t = "";
 848      for (let n in e) t += e[n]; 849      return t;
 850    }
 851    function P() {
Wrap the body of a for-in loop in an if statement with a hasOwnProperty guard
  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        },