15 lines
546 B
Markdown
15 lines
546 B
Markdown
|
---
|
||
|
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)
|