This is the function that is working.
const delayedColorChange = (color, delay) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
document.body.style.backgroundColor = color;
resolve();
}, delay);
});
};
const rainbow = async() => {
await delayedColorChange('red', 1000);
await delayedColorChange('orange', 1000);
await delayedColorChange('yellow', 1000);
await delayedColorChange('green', 1000);
await delayedColorChange('blue', 1000);
await delayedColorChange('indigo', 1000);
await delayedColorChange('violet', 1000);
await delayedColorChange('pink', 1000);
return 'ALL DONE';
};
rainbow().then(console.log);
Trying to make delayedColorChange into an async function.
const delayedColorChange = async (color, delay) => {
setTimeout(() => {
document.body.style.backgroundColor = color;
}, delay);
};
In this code the backgrounColor on the website is going straight to pink.
why is that?
Basically, is there any way to make delayedColorChange into an async function?
To my understanding, async functions returns a promise, so, why not just use an async function, instead of having to create a "new Promise" in a regular function?.
Is this even possible?
Sorry for the loaded post.
modafinil 100 mg – order provigil online provigil online
order accutane canada – buy accutane online uk accutane singapore buy
buy amoxicillin noscript canada – generic amoxicillin cost amoxicillin no prescription
buy generic vardenafil uk – viagra cialis vardenafil order online lola vardenafil generic
cost of ivermectin medicine – ivermectin pills canada ivermectin 20 mg
prescription cialis uk – tadalafil india brand buy cialis without prescription
ivermectin 4 – stromectol south africa stromectol 3 mg tablet price
how much is accutane – price of accutane in australia accutane singapore buy
lyrica south africa – canadian pharmacy generic levitra legitimate canadian pharmacy
generic amoxicillin at walmart – amoxicillin without a doctor’s prescription buy amoxil
viagra 25 mg tablet price – female viagra tablet viagra paypal canada
buy generic cialis cheap – cialis pills 20mg tadalafil 100
stromectol canada – ivermectin uk coronavirus ivermectin human
prednisone us – order prednisone online prednisone brand name uk
provigil dosage – generic modafinil modafinil adhd
order zithromax 250mg – zithromax online buy zithromax
order lasix online – lasix india lasix 20
generic clomiphene 100mg online – order clomid online clomid 100mg
buy cialis in uk – cialis generic over the counter best buy cialis online
brand name cialis for sale – Cialis online store india cialis pharmacy
accutane 20 mg buy online – canada online pharmacy accutane accutane cost in canada
793366 301969Merely wanna input on couple of general things, The web site design is perfect, the subject material is rattling superb : D. 522564
orlistat mayo – orlistat medication class xenical rx
tadalafil daily online tadalafil without a doctor prescription
cost of cialis where to get tadalafil
tadalafil buy generic cialis online with mastercard
generic cialis tadalafil what is tadalafil
generic cialis online fast shipping cheap generic cialis for sale
tadalafil order online no prescription tadalafil daily online
where to buy generic cialis online safely buy cialis
stromectol 3 mg tablets http://stromectolusdt.com/
963696 993066Id always want to be update on new content material on this site , saved to fav! . 224716