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

1861Suggestion for error

Expand Messages
  • Luke Page
    Feb 2, 2011
    • 0 Attachment
      if (a !== a) {
      }

      if (a === a) {
      }

      I've just debugged a piece of code where someone a long time ago thought
      they were adding a check to see if the argument they had been passed was
      equal to a field - but had mis-typed or mis-copy and pasted. It took a while
      to find it because when I looked at the code I saw what the writer had
      intended, not what was actually written. So the code should have been

      if (a !== this.a) {
      // perform change
      }

      I can't think when

      if (a !== a) {
      }

      or

      if (a === a) {
      }

      would be valid...


      [Non-text portions of this message have been removed]
    • Show all 2 messages in this topic