{"id":7593,"date":"2015-09-01T17:21:36","date_gmt":"2015-09-01T17:21:36","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/09\/01\/jshint-considers-a-for-in-variable-bad-what-does-this-mean-open-source-projects-jshint-jshint\/"},"modified":"2015-09-01T17:21:36","modified_gmt":"2015-09-01T17:21:36","slug":"jshint-considers-a-for-in-variable-bad-what-does-this-mean-open-source-projects-jshint-jshint","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/09\/01\/jshint-considers-a-for-in-variable-bad-what-does-this-mean-open-source-projects-jshint-jshint\/","title":{"rendered":"JSHint considers a for-in variable &#39;bad&#39;. What does this mean?-open source projects jshint\/jshint"},"content":{"rendered":"<p>The following code:<\/p>\n<pre><code>var things = {'foo':'bar'}\nfor ( thing in things ) {\n  console.log(thing)\n}\n<\/code><\/pre>\n<p>Consistently produces the following error in jshint:<\/p>\n<pre><code>Bad for in variable 'thing'.\n<\/code><\/pre>\n<p>I do not understand what makes the &#8216;thing&#8217; variable &#8216;bad&#8217; &#8211; as you can see, it is not being used anywhere else. What should I do differently to make jshint not consider this to be an error?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following code: var things = {&#8216;foo&#8217;:&#8217;bar&#8217;} for ( thing in things ) { console.log(thing) } Consistently produces the following error in jshint: Bad for in variable &#8216;thing&#8217;. I do not understand what makes the &#8216;thing&#8217; variable &#8216;bad&#8217; &#8211; as you can see, it is not being used anywhere else. What should I do differently [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7593","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7593"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7593\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}