Can (a == 1 && a == 2 && a == 3) Ever Evaluate to 'true'? stackoverflow.com/q/48270127/3951 (Not very useful but it turns out, yes, it's possible to make it happen in JavaScript.)
Frankly I find it a useless, "lawyer" question - it is one in a gazillion to hit it in real life, less than 10 people will ever benefit of this knowledge, it bloats corner-case-theoretical questions, but it is considered pro-knowledge. Useful if you will create ES-10, probably...
That's why you gotta === every time! Like the billboard says: "==: not even once".
a = true. Hilarious type juggling ensues.
it should be incrementing object field and overriding valueOf ) but I knew that it's possible, that is always easier
thats really cool haha, so a friend of mine made a nice answer in C++ : struct{ bool operator== (const int content) const { return true } } a; int main(){ if (a == 1 && a == 2 && a ==3) printf("worked"); return 0 }
United States Trends
- 1. #CARTMANCOIN 1,797 posts
- 2. Broncos 66.9K posts
- 3. yeonjun 233K posts
- 4. Raiders 66.3K posts
- 5. Bo Nix 18.4K posts
- 6. Geno 18.8K posts
- 7. daniela 49.7K posts
- 8. Sean Payton 4,824 posts
- 9. #criticalrolespoilers 5,081 posts
- 10. Kehlani 10.2K posts
- 11. #iQIYIiJOYTH2026xENGLOT 395K posts
- 12. #TNFonPrime 4,052 posts
- 13. #Pluribus 2,883 posts
- 14. Kenny Pickett 1,513 posts
- 15. Danny Brown 3,148 posts
- 16. Chip Kelly 1,996 posts
- 17. Bradley Beal 3,656 posts
- 18. TALK TO YOU OUT NOW 28.8K posts
- 19. Vince Gilligan 2,523 posts
- 20. byers 30.5K posts
Something went wrong.
Something went wrong.