简体   繁体   English

JavaScript Vs Typescript中的类

[英]class in JavaScript Vs Typescript

I read on this ECMAScript page that 'class' is part of JavaScript. 我在这个ECMAScript 页面上读到'class'是JavaScript的一部分。 On this page about TypeScript , I see the 'class' is available in Typescript too. 在关于TypeScript的这个页面上,我看到了“类”中的“类”也可用。

My question is, the right approach to develop JavaScript applications FOR FUTURE is to take advantage of (a) the Object Oriented features in JavaScript and the features that will be availablein EMACScript 7.0 or (b) use libraries like TypeScript 我的问题是,开发未来JavaScript应用程序的正确方法是利用(a)JavaScript中的面向对象功能以及EMACScript 7.0中可用的功能或(b)使用TypeScript等库

My question is, the right approach to develop JavaScript applications FOR FUTURE is to take advantage of (a) the Object Oriented features in JavaScript and the features that will be availablein EMACScript 7.0 or (b) use libraries like TypeScript 我的问题是,开发未来JavaScript应用程序的正确方法是利用(a)JavaScript中的面向对象功能以及EMACScript 7.0中可用的功能或(b)使用TypeScript等库

Either is fine. 要么没事。 Depends upon if you want type safety . 取决于您是否想要类型安全

If not there is stuff like babeljs . 如果没有像babeljs这样的东西。 https://babeljs.io/ https://babeljs.io/

If yes then use typescript http://www.typescriptlang.org/ 如果是,那么使用typescript http://www.typescriptlang.org/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM