Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let Promise created by leodotng - https://repl.it/K9Di/2
// Here is the video https://www.youtube.com/watch?v=490Hhpqaho4
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);
});
promise.then(
resolved => console.log(resolved),
error => console.error(error)
);
@leodotng

This comment has been minimized.

Copy link

@leodotng leodotng commented Aug 31, 2017

Javascript Promises video: https://www.youtube.com/watch?v=490Hhpqaho4

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