Loading ...
Sorry, an error occurred while loading the content.

Re: [jslint] Bad for in variable when using a function argument

Expand Messages
  • Douglas Crockford
    It wants you to be using a local var. Using a parameter looks like a mistake.
    Message 1 of 2 , Mar 25, 2010
    • 0 Attachment
      It wants you to be using a local var. Using a parameter looks like a
      mistake.

      On 3/25/2010 4:49 PM, Marcel Duran wrote:
      > (function () {
      > var foo = function (bar) {
      > var o = {};
      > for (bar in o) {
      > if (o.hasOwnProperty(bar)) {
      > console.log(o[bar]);
      > }
      > }
      > };
      > foo('foobar');
      > }());
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.