JavaScript Reserved Keywords

JavaScript statements begin with a "reserved keyword" and perform a specific task. For example, the "var" keyword instructs the browser to create a variable. This article provides a list of the keywords used in JavaScript. It is important to remember that a "variable" or "function" cannot use keywords. This is another interactive reference to use as you learn to write JavaScript statements.

Reserved word usage

Reserved words actually only apply to Identifiers (vs. IdentifierNames) . As described in es5.github.com/#A.1, these are all IdentifierNames which do not exclude ReservedWords.

a.import
a['import']
a = { import: 'test' }.

On the other hand the following is illegal because it's an Identifier, which is an IdentifierName without the reserved words. Identifiers are used for FunctionDeclaration, FunctionExpression, VariableDeclaration and so on. IdentifierNames are used for MemberExpression,CallExpression and so on.

function import() {} // Illegal.