【文件属性】:
文件名称:proposal-iterator-helpers:ECMAScript中使用迭代器的方法
文件大小:12KB
文件格式:ZIP
更新时间:2021-05-03 16:56:24
javascript iterators ecmascript-proposal tc39 HTML
迭代器助手
提议
关于多个接口的建议,这些接口将有助于ECMAScript中迭代器的常规使用和使用。 许多已经提供了这些接口。
该提案处于第二阶段。
有关语义决策的详细信息,请参见 。
见渲染这个建议
用法示例
function * naturals ( ) {
let i = 0 ;
while ( true ) {
yield i ;
i += 1 ;
}
}
const evens = naturals ( )
. filter ( ( n ) => n % 2 === 0 ) ;
for ( const even of evens ) {
console . log ( even , 'is an even number' ) ;
}
const MyIteratorPrototype = {
next ( ) { } ,
thr
【文件预览】:
proposal-iterator-helpers-master
----spec.html(39KB)
----DETAILS.md(1KB)
----.travis.yml(1KB)
----README.md(6KB)
----.travis_github_deploy_key.enc(3KB)
----.gitignore(80B)
----package.json(256B)