JavaScript Reserved Word List

Is there a more complete list than Mozilla about reserved words?

It lacks words like parseFloat, toString, prototype, etc.

+5
source share
1 answer

parseFloat, toStringand prototype- reserved words not . Just because they sometimes have a special meaning does not mean that you cannot declare variables with their names;

var prototype = "foo"; // no error.

The ES5 standard contains a list of reserved words, but it must match the list specified by MDN:

break, do, instanceof, typeof, case, else, new, var, catch, finally, return, 
void, continue, for, switch, while, debugger, function, this, with, default,
if, throw, delete, in, try

class, enum, extends, super, const, export, import

You may also be interested in the fact that the strict varient ES5 adds extra words to the reserved list;

"implements", "interface", "let", "package", "private", "protected", "public", "static", and "yield" FutureReservedWord . ( 7.6.1.2).

+10

All Articles