freeCodeCamp/guide/chinese/miscellaneous/the-es6-promises/index.md

15 lines
438 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: The Es6 Promises
localeTitle: Es6承诺
---
ES6的一项新功能可帮助实现异步编程。
## 句法
```
new Promise(executor);
new Promise(function(resolve, reject) { ... });
```
![MDN图片](//discourse-user-assets.s3.amazonaws.com/original/2X/8/803d67f7e823e9e50b55debaa82bb661543d2ddc.png)
在[MDN上](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)阅读更多内容