Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS开发下,ES6语法都支持? #60

Open
alanhe421 opened this issue Jul 12, 2018 · 0 comments
Open

TS开发下,ES6语法都支持? #60

alanhe421 opened this issue Jul 12, 2018 · 0 comments
Labels

Comments

@alanhe421
Copy link
Owner

alanhe421 commented Jul 12, 2018

TS号称是JS的超集,TS解决的问题即是它的定位,类型。所以可以在开发解决避免特别多的问题。
TS中实际上只要能够写出来,其实都是支持的。

比如这里,我使用ES6下的扩展运算符

const testArr = [1, 2, 3];
console.log(...testArr);

我们这里设定编译后的目标版本为es5
进行编译,通过源码我们会看到实际上,编译器帮我改写为ES5的写法了。

image

@alanhe421 alanhe421 changed the title ES6语法都支持? TS开发下,ES6语法都支持? Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant