Why is 'class' a reserved word in JavaScript?

JavascriptWeb DevelopmentFront End Technology

The following are the future reserved words, which include ‘class’. These words are used as keywords in proposed extensions and are therefore reserved to allow for the possibility of future adoption of those extensions.

class enum extends super
const export Import

The above is defined in the ECMAScript specification.
In ECMAScript 6 Language Specification it is used. The class declaration creates a class −

class name [extends] {
   // body of class
}


raja
Published on 17-Jan-2018 11:53:52
Advertisements