摘要: 基本概念 Generator 函数是一个状态机,封装了多个内部状态,执行 Generator 函数会返回一个遍历器对象 Generator 函数除了状态机,还是一个遍历器对象生成函数, 返回的遍历器对象,可以依次遍历 Generator 函数内部的每一个状态 function* helloWorldGenerator() { yield 'hello'; yield 'world'; return 阅读全文
posted @ 2019-09-27 14:29 初心不负 阅读(162) 评论(0) 推荐(0) 编辑