TypeScript是ES6的超集吗? [英] Is TypeScript a superset of ES6?

查看:267
本文介绍了TypeScript是ES6的超集吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

换句话说,所有ES6语法是否被TypeScript覆盖?



我的问题与...不同:




  • TypeScript真的是JavaScript的超集吗?

    ES6 不是(或者没有被考虑过,如果你在未来看到这个)当前版本的JavaScript

  • Typescript!= ES6?

    这是不同的,我知道,而不是我在问。


解决方案

根据当前语言规范可在网站上获得:


TypeScript是JavaScript的语法糖。 TypeScript语法是Ecmascript 5(ES5)语法的超集。


And:


TypeScript语法包括几个提出的Ecmascript 6(ES6)功能,包括类和模块。



In other words, is all ES6 syntax covered by TypeScript?

How is my question differente from:

  • "Is TypeScript really a superset of JavaScript?"
    ES6 isn't (or hasn't been considered if you read this in the futur) the current version of Javascript
  • Is Typescript != ES6?
    It's different, I know that, not what I'm asking.

解决方案

Based on the current language specification available at the website:

TypeScript is a syntactic sugar for JavaScript. TypeScript syntax is a superset of Ecmascript 5 (ES5) syntax.

And:

TypeScript syntax includes several proposed features of Ecmascript 6 (ES6), including classes and modules.

这篇关于TypeScript是ES6的超集吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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