You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
//# Basic promise usage
//This is how the basic mechanism works.
//Create a new Promise with resolve and reject parameters.
//Call those parameters when a condition is met, or fails to be met
let promise = new Promise((resolve, reject) => {
let x = 10;
//Try changing x to another number to see what happens when it's rejected
if (x === 10) {
resolve("promise resolved");
} else {
reject("promise rejected");
}
});