why is class a reserved word in JavaScript?

后端 未结 5 1923
渐次进展
渐次进展 2020-11-29 08:25

I am planning to implement class inherit interface using JavaScript. class is the perfect word as the name of the constructor.

class = function          


        
5条回答
  •  孤街浪徒
    2020-11-29 09:02

    It is there so that support can be added in future without breaking existing programs. Please take a look at the following post.

    You can also look at

    https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words

提交回复
热议问题