[英]Where can I learn JavaScript features not yet included in ECMAScript standard?
I just tried in Firebug console, 我刚试过Firebug控制台,
let (X=10) X/2
and 和
[x,y]=[y,x]
These are features supported by SpiderMonkey, I guess V8 has its own share. 这些是SpiderMonkey支持的功能,我猜V8有自己的共享。
Where can I learn of features that are not yet included in ECMAScript, but work in various browsers? 我在哪里可以了解ECMAScript中尚未包含但在各种浏览器中工作的功能? Is there a place where these are collected together? 有没有这些收集在一起的地方?
ECMAScript 6 (aka ECMAScript 2015) is the current standard for JavaScript, but engines have yet to implement it completely: ECMAScript 6(又名ECMAScript 2015)是JavaScript的当前标准,但引擎尚未完全实现它:
Starting with ECMAScript 2016, there will be yearly releases and a new release process: 从ECMAScript 2016开始,将有每年发布和新的发布过程:
Blog post explaining the new release process and the features that are candidates for ES2016: http://www.2ality.com/2015/11/tc39-process.html 博客文章解释新发布流程和ES2016候选功能: http ://www.2ality.com/2015/11/tc39-process.html
Official list of proposed features (that may or may not be accepted for the ECMAScript standard): https://github.com/tc39/ecma262 官方列出的建议功能(ECMAScript标准可能接受也可能不接受): https : //github.com/tc39/ecma262
Feature table for ES2016: http://kangax.github.io/compat-table/es7/ ES2016功能表: http ://kangax.github.io/compat-table/es7/
If you want to use any of the new features even on older engines, you can transpile them to ES5 via Babel: https://babeljs.io/ 如果您想在旧引擎上使用任何新功能,可以通过Babel将它们转换为ES5: https ://babeljs.io/
And here is a article covering various resources around Harmony/ES6/Javascript.next: 这是一篇涵盖Harmony / ES6 / Javascript.next的各种资源的文章:
http://addyosmani.com/blog/ecmascript-6-resources-for-the-curious-javascripter/ http://addyosmani.com/blog/ecmascript-6-resources-for-the-curious-javascripter/
That first feature is known as a " let
expression" and it is nonstandard; 第一个特征被称为“ let
表达”,它是非标准的; it was dropped from Firefox 41, and the similarly nonstandard " let
block" was dropped from Firefox 44: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Non-standard_let_extensions 它从Firefox 41中删除,类似的非标准“ let
block”从Firefox 44中删除: https : //developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Non-standard_let_extensions
I was surprised to find that this particular non-standard JS was not mentioned in Kangax's table, but I guess he had to restrict this list to non-standard JS extensions that are supported by multiple engines: https://kangax.github.io/compat-table/non-standard/ 我很惊讶地发现在Kangax的表中没有提到这个特殊的非标准JS,但我猜他必须将此列表限制为多个引擎支持的非标准JS扩展: https : //kangax.github.io / compat的表/非标准/
If you want to go deeper down the rabbit-hole, and Kangax and MDN haven't satisfied your curiosity, this old reference may tell you about curiosities in older browsers: help.dottoro.com/ljsdaoxj.php 如果你想深入挖掘兔洞,Kangax和MDN不满足你的好奇心,这个旧参考可能会告诉你旧浏览器中的好奇心:help.dottoro.com/ljsdaoxj.php
Beyond that, the browser-makers usually document the quirks of their own browsers (MDN is also good about documenting non-Mozilla quirks, but it's not perfect); 除此之外,浏览器制造商通常记录他们自己的浏览器的怪癖(MDN也非常适合记录非Mozilla怪癖,但它并不完美); speaking of quirks, Peter-Paul Koch documents both standard and non-standard DOM methods here: quirksmode.org/dom/ 谈到怪癖,Peter-Paul Koch在这里记录了标准和非标准的DOM方法:quirksmode.org/dom/
Anyway, these aren't just "not yet" in the standards, but likely "not ever" and you shouldn't use them in your own code. 无论如何,这些不仅仅是“尚未”的标准,但可能“永远不会”,你不应该在你自己的代码中使用它们。
For current ECMAScript 264 implementation here is a list of features supported by different browser vendors: http://kangax.github.com/es5-compat-table/ 对于当前的ECMAScript 264实现,这里列出了不同浏览器供应商支持的功能: http : //kangax.github.com/es5-compat-table/
For the next generation ECMAScript Harmony some resources: 对于下一代ECMAScript Harmony的一些资源:
http://addyosmani.com/blog/ecmascript-6-resources-for-the-curious-javascripter/ http://addyosmani.com/blog/ecmascript-6-resources-for-the-curious-javascripter/
http://kangax.github.com/es5-compat-table/es6/ http://kangax.github.com/es5-compat-table/es6/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.