A fulfilled promise has successfully obtained its promised value. It enters this state when its resolve function is called, and cannot later switch to rejected or another state. section 6.3.2
A value arrives
A promise resolved immediately with "Hattori" fulfills; its then success callback receives that value. A timeout can also resolve a promise later with "Hattori". section 6.3 section 6.3.2
Listing 6.10. Creating a simple promise
const ninjaPromise = new Promise((resolve, reject) => { #A
resolve("Hattori"); #B
//reject("An error resolving a promise!"); #B
});
ninjaPromise.then(ninja => { #C
assert(ninja === "Hattori", "We were promised Hattori!"); #C
}, err => { #D
fail("There shouldn't be an error") #D
}); #D
See a promise resolve with a value and pass it to the success callback. section 6.3

