ES6中未实现哪些打字稿功能? [英] Which Typescript Features are Not Implemented in ES6?

查看:99
本文介绍了ES6中未实现哪些打字稿功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了显而易见的类型系统外,我还了解到TypeScript中的某些功能在ES6中不可用.这篇文章没有提到这些功能是什么,或者为什么应该避免使用这些功能.

Apart from the obvious type system, I have read that there are features in TypeScript that are not available in ES6. The article did not mention what these features were or why they should be avoided.

我已经知道TypeScript实现了ES7 async/await语法,并且该帖子(哪些ES6功能是在Typescript中实现的)为我们提供了相反的关系.

I am already aware that TypeScript implements ES7 async/await syntax and this post (Which ES6 Features are Implemented in Typescript) gives us the inverse relationship.

推荐答案

ES 6中不存在的新功能

  1. 装饰器
  2. 抽象类
  3. 命名空间(模块)
  4. 枚举
  5. 泛型界面
  6. 可选属性和参数
  7. 函数重载
  8. 默认参数
  9. 访问修饰符
  1. Decorators
  2. Abstract classes
  3. Namespace (Module)
  4. Enums
  5. Generics and Static typing
  6. Interfaces
  7. Optional properties and arguments
  8. Function overloads
  9. Default parameters
  10. Access modifiers

@A Red Herring 说:

TypeScript是JavaScript的超集,而不是相反的,因此有意义的是,TypeScript中的许多功能都不会在ES6中出现

TypeScript is a superset of JavaScript, not the other way around, so it makes sense that many features in TypeScript will not be present in ES6

这就是为什么不要忘记纯粹的JS功能,用JS而不是用TypeScript进行思考的原因

这篇关于ES6中未实现哪些打字稿功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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