Home > Web Front-end > JS Tutorial > body text

Keywords and reserved words sorting in Javascript_Basic knowledge

WBOY
Release: 2016-05-16 16:33:44
Original
1175 people have browsed it

ECMA-262 describes a set of keywords with specific purposes, which can be used to indicate the beginning or end of a control statement, or to perform specific operations, etc. Regulation: Keywords are language reserved and cannot be used in identifiers.

All ECMAScript keywords (*new for the fifth edition):

break do instanceof typeof case else new var catch finally return void continue for switch

All reserved words in ECMA-262 (3rd edition):

abstract enum int short boolean export interface static byte extends long super char final native class

synchronized  float  package  throws const  goto  private  transient  debugger  implementations  protected  volatile  double 

import public

Reserved words may be used as keywords in reprints. For example, the new debugger in the fifth edition is a reserved word in the third edition.

Reserved words in non-strict mode in the fifth edition:

class enum extends supper const export import

Reserved words in strict mode:

implements package public interface private static let protected yield

Note: let and yield are new reserved words; to ensure compatibility, they are recommended as reference reserved words.

Using keywords and reserved words in Javascript will result in an error. Not recommended!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template