iterators.ts:Typescript中的:couch_and_lamp:Rustical迭代器
Typescript中的惰性迭代器JavaScript迭代器很烂... const it = Iter . fromArray ( [ 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' , 'j' , 'k' , 'l' ] ) . enumerate ( ) . map ( ( [ k , v ] ) => [ k , v . toUpperCase ( ) ] ) . filter ( ( [ k , v ] ) => k % 2 == 0 ) . map ( ( [ , v ] ) => v ) const collected = it . take ( 3 ) . intoArray ( ) ; // -> [ 'A', 'C', 'E'] const collected2 = it
iterators_ts-master.zip
预估大小:9个文件
iterators.ts-master
文件夹
.gitignore
37B
package.json
626B
src
文件夹
index.ts
10KB
tsconfig.json
980B
examples
文件夹
simple.ts
543B
README.md
424B
renovate.json
41B
16.57KB
文件大小:
评论区