30

面试:你知道为什么会有 Generator 吗

 6 years ago
source link: https://juejin.im/post/5adae8246fb9a07aa541e150
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
之前面试时有被问到为什么会有 Generator, 还好没懵逼。想知道的吗,往下翻。 原文链接 循环的问题 ES5 里遍历一个数组需要这样: const colors = ["red", "green", "blue"]; for (var i = 0, le

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK