top | item 42559245

(no title)

MH15 | 1 year ago

In a similar vein to "use strict" we could create a new directive that disallows JS features like var, prototype, == (in favor of ===). Modules with this new directive at the top of the file would be executed under these new rules. You'd be able to create new (maybe lighter weight) JS interpreters that only target this subset.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

discuss

order

para_parolu|1 year ago

I don’t think anyone uses var anymore. Linters and prettier are doing a good job keeping codebase consistent. Operator == has a valid use case (null or undefined check) but rarely allowed as well.

But I wouldn’t mind to have language without legacy.

bguebert|1 year ago

It's kinda ironic to post that on a site that uses var in its javascript

wruza|1 year ago

I use var, together with let and const, where appropriate. What’s the problem with var I don’t get it.