3 ms·
Or just: const p = {then: () => 0}
by ehsankia 7y ago
Or just:
const p = {then: () => 0}
- hombre_fatal 7y agoWell, an object with a then() method is a promise. Promise.resolve({then: () => console.log('called')}) Promises autoflatten since you can't have Promise<Promise<T>>, so you'll see that this code prints 'called'.