正如promises 类似于结构化的回调,async/await类似于组合生成器(combininggenerators)和promises。 Just as Promises are similar to structured callbacks, async/await is similar to combining generators and promises. . 请注意,使用promises 的迭代器不可能达到相同的结果。 Note that it's not possible to use an iterator of promises to achieve the same result. 正如Promises 类似于结构化回调,async/await更像结合了generators和promises。 Just as Promises are similar to structured callbacks, async/await is similar to combining generators and promises. . 月,2008Promises Pencils开始运作,这一切都始于一个问题。 In October 2008 Pencils of Promise was set into motion, and it all began with a single question. 在我们开始使用promises 之前,让我们首先重新审视Node.js中的回调函数。 Before we start with promises , let's first revisit what are"callback" functions in Node. js. Async/await的目的是简化使用多个promise时的同步行为,并对一组Promises 执行某些操作。 The purpose of async/await functions is to simplify the behavior of using promises synchronously and to perform some behavior on a group of Promises . 唯独,那并不便于阅读和编排,所以有了Promises 。 Still, it is not that easy to read nor to write- so comes the Promises . 我们基本上要做的就把一个列表的文件路径,转换为一个列表的文件状态promises . All we're basically doing is mapping a list of paths to a list of promises for stats. Async/await的目的是简化使用多个promise时的同步行为,并对一组Promises 执行某些操作。 Async/await: Their purpose is to simplify the behavior of using promises synchronously and to perform some behavior on a group of Promises . JavaScript开发者们,现在是时候承认一个事实了:我们在promises 的使用上还存在问题。 Fellow JavaScripters, it's time to admit it: we have a problem with promises . Async/await函数的目的是简化同步使用promise的行为,并对一组promises 执行一些处理。 The purpose of async/await functions is to simplify the behavior of using promises synchronously and to perform some behavior on a group of Promises . Async(异步)函数或多或少允许你编写顺序的JavaScript代码,而无需将所有逻辑包装在callbacks(回调),generators(生成器)或promises 中。 Async functions more or less let you write sequenced JavaScript code, without wrapping all your logic in callbacks, generators, or promises . No Comments on Promises . The ultimate of promises . 学习JavaScriptPromises 的最佳资源. The best resources to learn about JavaScript Promises . So then we make promises . Faster async functions and promises . 异步流程控制,promises 和callbacks。 Asynchronous control flow, promises , and callbacks. Promises made that can be kept.III、上帝应许希望(GodPromises Hope). God's Promises( promises from God).
Display more examples
Results: 132 ,
Time: 0.0244