4 ms·
> By comparison there are 53 reserved words in Java and only 33 in Javascript. Where did you find these numbers? I'm trying to find them but I can only find t
by animationwill 6y ago
> By comparison there are 53 reserved words in Java and only 33 in Javascript.
Where did you find these numbers? I'm trying to find them but I can only find the Ecmascript and the number appears way higher
- fanf2 6y ago39 listed here https://tc39.es/ecma262/2020/#sec-keywords-and-reserved-words https://tc39.es/ecma262/2020/#sec-keywords-and-reserved-word... 51 listed here https://docs.oracle.com/javase/specs/jls/se15/html/jls-3.html#jls-3.9 https://docs.oracle.com/javase/specs/jls/se15/html/jls-3.htm... with a bunch of non keywords listed below, of which true false and null are also reserved
- shaftway 6y agoFor Java I used https://www.thoughtco.com/reserved-words-in-java-2034200 https://www.thoughtco.com/reserved-words-in-java-2034200 but Wikipedia lists 51. I'm too lazy to actually diff it. For Javascript I used https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... and fudged the numbers a bit. There are future reserved words, but I didn't iinclude them because there's no point in memorizing them. Now that I look in detail that list also doesn't include "true", "false", and "null".