Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

New in JavaScript 1.7

这篇翻译不完整。请帮忙从英语翻译这篇文章

The following is a changelog for JavaScript 1.7. This version was included in Firefox 2 (October 2006).

JavaScript 1.7 is a language update introducing several new features, in particular generators, iterators, array comprehensions, let expressions, and destructuring assignment.

使用 JavaScript 1.7

为了使用 JavaScript 1.7的一些新特性,你需要明确指出你希望使用 JavaScript 1.7。在HTML 或XUL code中,使用:

 

When using the JavaScript shell, you need to set the version you wish to use using the -version 170 switch on the command line or using the version() function:

version(170);

The features that require the use of the new keywords "yield" and "let" require you to specify version 1.7 because existing code might use those keywords as variable or function names. The features that do not introduce new keywords (destructuring assignment and array comprehensions) can be used without specifying the JavaScript version.

JavaScript 1.7的新特性

The following features added with JavaScript 1.7 were not part of an ECMA-262 standard at the time. In more recent Firefox versions, the implementation is updated to work with semantics as specified in ECMAScript Edition 6. Please see the reference pages for differences.

文档标签和贡献者

 此页面的贡献者: wth, teoli, ziyunfei, pokerqueen
 最后编辑者: wth,