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

Re: For in filter

Expand Messages
  • Ezequiel
    I remember reading JSLint s source and seeing a is_own function to filter forins. Apparently, it seems Crockford has switched to actually writing
    Message 1 of 6 , Mar 20, 2011
    • 0 Attachment
      I remember reading JSLint's source and seeing a is_own function to filter forins.

      Apparently, it seems Crockford has switched to actually writing Object.hasOwnProperty.call out every single time and jslint followed accordingly. Okay.


      --- In jslint_com@yahoogroups.com, "Ezequiel" <thehungerforce@...> wrote:
      >
      > Because I'm using my own function for the if statement, this doesn't work:
      >
      > example:
      >
      > var isOwnProperty, object, i;
      >
      > isOwnProperty = function(object, key) {....};
      >
      > object = {zero: 0};
      >
      > for (i in object) {
      > if (isOwnProperty(object, i)) {
      > ...
      > }
      > }
      >
      > However, it works if my if statement was something like... object.hasOwnProperty(i);
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.