Endle / fireSeqSearch

Prefer that for-in loops should include an if statement JS-0051
Anti-pattern
Minor
9 months agoa year old
Wrap the body of a for-in loop in an if statement with a hasOwnProperty guard
1227    WordCloud.minFontSize = minFontSize
1228    WordCloud.stop = function stop () {
1229        if (timer) {
1230            for (var timerId in timer) {1231                window.clearImmediate(timer[timerId])1232            }1233        }
1234    }
1235
Wrap the body of a for-in loop in an if statement with a hasOwnProperty guard
 846                        span.style[cssProp] = styleRules[cssProp]
 847                    }
 848                    if (attributes) {
 849                        for (var attribute in attributes) { 850                            span.setAttribute(attribute, attributes[attribute]) 851                        } 852                    }
 853                    if (classes) {
 854                        span.className += classes
Wrap the body of a for-in loop in an if statement with a hasOwnProperty guard
 842                        styleRules.color = color
 843                    }
 844                    span.textContent = word
 845                    for (var cssProp in styleRules) { 846                        span.style[cssProp] = styleRules[cssProp] 847                    } 848                    if (attributes) {
 849                        for (var attribute in attributes) {
 850                            span.setAttribute(attribute, attributes[attribute])