Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
let Promise created by leodotng -
// Here is the video
let promise = new Promise((resolve, reject) => {
//always put resolve and reject in there
let value = true;
setTimeout(() => {
if (value) {
resolve('this value is true!');
} else {
reject('This value is not true.');
}, 3000);
resolved => console.log(resolved),
error => console.error(error)

This comment has been minimized.

Copy link

@leodotng leodotng commented Aug 31, 2017

Javascript Promises video:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment