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

Re: Suggestion for error

Expand Messages
  • Douglas Crockford
    ... Good idea. Please try it now.
    Message 1 of 2 , Feb 2, 2011
    View Source
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, Luke Page <luke.a.page@...> wrote:
      > 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...

      Good idea. Please try it now.
    Your message has been successfully submitted and would be delivered to recipients shortly.