Async Generator Functions
Async functions
什麼是 Async Functions?
async function foo() {
return 10;
}
console.log(foo()); // Promise {<resolved>: 10}
console.log(foo().then(result => console.log(result))); // 10Promise? WTF?
Callback
// jQuery
$.get( "ajax/test.html", function( data ) {
console.log(data);
});Promise
Async & Await
Generator Functions
什麼是 Generator Functions?
Generator Function 的使用案例
Async Generator Functions
Last updated
Was this helpful?