javascript - Creating global 'for' variable. Should be 'for (var items ...' -
i using jshint. can tell me why it's treating "for" keyword global variable?
creating global 'for' variable. should 'for (var items ...'
here's loop:
//items , properties defined above... var items = null, properties = someobject; //code here terminated ; "semicolon" (items in properties) { if (properties.hasownproperty(items)) { //some code here... } }
it nothing for
items
within construct.
if go
for (items in properties) {
and items
not defined, items
global variable. since jshint complaining, don't declare items
in scope of construct, though let in example code.
if it's defined, suggest file bug report jshint :-)
Comments
Post a Comment