Javascript中的类关键字 [英] Class keyword in Javascript

查看:129
本文介绍了Javascript中的类关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据本文它应该是一个Javascript 2.0的方式来定义类。但是,我从来没有在实践中看到。因此问题。如何使用类关键字和Javascript 1.x之间的区别是什么?

According to this article it should be a Javascript 2.0 way to define class. However, I never saw that in practice. Thus the question. How to use class keyword and what is the difference between Javascript 1.x way of doing things?

推荐答案

实践中使用的 class 关键字是 all当前的JavaScript实现是1.x.

The reason you never saw the class keyword used in practice is that all the current implementations of JavaScript are 1.x.

JavaScript 2.0被合并到ECMAScript 4中,这是相当不受欢迎的,因此从未进入真实世界。

JavaScript 2.0 was merged into ECMAScript 4 which was rather unpopular and so never made it into the real world.

所以要回答你的问题,你如何使用 class 关键字?你不能。

So to answer your question, how do you use the class keyword? You can't.

这篇关于Javascript中的类关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆