I am planning to implement class inherit interface using JavaScript. class
is the perfect word as the name of the constructor.
class = function (classname) {}; // create a class with classname
classA = new class("classA"); // create a class named classA
Unfortunately, class
is a reserved word in JavaScript.
Why does JavaScript reserve the word class
(since it never uses it)?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…