Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
My guess is some browsers have more forgiving JavaScript engines. Like how each browser handles HTML differently, some will try to guess what was supposed to be there if you have a small syntax error.
-
navster6438yI think you might be right. This caught me out royally today. iOS 10 must be shipped with the latest version of WebKit installed and allowed this. iOS 9 does not, however. I was debugging a hybrid app in Chrome and iOS 10... Moral of the story, test on everything!!
-
navster6438y@rtannerf oh really... so what the heck was it trying to achieve if I was 'aiming' to compare something to something else 😕
-
navster6438y@rtannerf I see! That makes perfect sense, thank you! I was starting to go slightly mad I must admit. Makes sense that Apple has upgraded WebKit with some ES6 support in their latest update I guess. Indeed, too clever for its own good...
-
topfs438y@rtannerf even more interesting is that the value of oranges doesn't matter as you never execute the function, so it always resolves to true for the if statement
Can anyone explain why in JS this >= when written like => works in some browsers and not others? What is the latter? Other than an incorrect syntax when doing a comparison of greater than or equal to?
undefined