4 ms·
Python I can understand because of the 2 to 3 transition. But JavaScript that worked in 1995 still works today. All of it.
by junon 4y ago
Python I can understand because of the 2 to 3 transition.
But JavaScript that worked in 1995 still works today. All of it.
- robertlagrant 4y agoPresumably that's not true for any code that uses modern keywords such as class or super or await as variable names.
- ecnahc515 4y agoI can't recall as I don't do Javascript development regularly, but doesn't that require `"use strict"`?
- deleted 4y ago[deleted]
- bakkoting 4y agoIt is, actually. Well, "class" and "super" were never legal even before they became keywords, because the language was designed to evolve and those were obvious things which might be useful later. But "await" still works as a variable name outside of an async function, even today, precisely so that old code still works as it used to. There are some contortions in the specification (and implementations) required to make this work, but it does work. (I am one of the current editors of the JS specification.)
- robertlagrant 4y agoHuh! Fair enough.