28

30 min figuring out what happen to my code. And realize that = is used in if statement instead of ==.

Thanks brain

Comments
  • 7
    I see posts like these too often.
    Do you guys not use a decent IDE or linting plugins for your text editor? Stuff like that should stand out the moment you write it
  • 1
    Modern compiler also fire a warning which should not be ignored
  • 1
    Plus if this is JS, definitely use ===
  • 0
    @Hedgepig isn't that only for case sensitivity?
  • 0
    How does this happen? If the most basic ide throws warnings about this kinda stuff
  • 1
    @inukinator No, it's for strict type checking.
  • 0
    That's why passing primitives as const values is a good idea
  • 0
    @inukinator JS uses type coercion, so 1 == '1' will evaluate to true. Whereas 1 === '1' will be false. Type coercion, is terrible and unpredictable
Add Comment