(no title)
cronin101 | 1 year ago
Can you elaborate on this part? I would say one of the strengths of JS is that you can get it to run consistently just about anywhere.
cronin101 | 1 year ago
Can you elaborate on this part? I would say one of the strengths of JS is that you can get it to run consistently just about anywhere.
bubblebeard|1 year ago
Every browser implements a version of ECMAScript (this is a specification declaring what features of the JS language will be available for the JS engine included with the browser).
This means that every browser on the planet, and every version of them, support different JS features.
For example, let and const are commonly used to define variables, but if someone happens to use an old browser version the use of these would cause an error, which in turn may cause all the rest of JS code to stop executing, resulting in (worst case scenario) your website being rendered useless to that particular person.
On top of that different browsers may use different engines. So even if they define the same ES version the code may still execute differently (this was for example a very big issue with Microsoft browsers in the past).
This may seem trivial, but new JS features emerge all the time. Granted, this was a much bigger problem before ~2015 something, but it’s by no means none existent today.
Thus, you cannot be sure the code you write locally will actually function the same everywhere, and you are unlikely to know how often failures even occur since it all happens client side.
cronin101|1 year ago