We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如题
The text was updated successfully, but these errors were encountered:
Generator 是一种特殊的函数,可以在运行过程中暂停并恢复。在每次运行到 yield 关键字时,函数会暂停,并将 yield 后面的表达式的值作为函数的返回值。之后,每次再调用 next() 方法时,函数会从上次暂停的位置继续执行,直到再次遇到 yield 关键字。
通过使用 Generator,我们可以更灵活地控制异步操作的执行,例如实现以同步的方式书写异步代码。此外,Generator 还可以用于实现惰性计算、迭代器、状态机等复杂的流程控制场景。
Sorry, something went wrong.
No branches or pull requests
如题
The text was updated successfully, but these errors were encountered: