JavaScript Gotcha: Why [x == (a || b)] Fails
![JavaScript Gotcha: Why [x == (a || b)] Fails JavaScript Gotcha: Why [x == (a || b)] Fails](https://nishantrana.me/wp-content/uploads/2018/08/cropped-nishantrana.jpg?w=200)
Recently we observed that our JavaScript code was not working as expected. Now when we write conditions in JavaScript, it’s natural to want to check if a variable equals one of multiple values. A common mistake is to write the condition like this: At first glance, it seems like this would check if ‘loanType’ is … Continue reading "JavaScript Gotcha: Why [x == (a || b)] Fails"
Published on:
Learn more