Skip to content

How to Use Class Instead of ID

I have this code from this question How To Create Multiple CountDown Timers In The Same Page Using Javascript?. I am not a JavaScript expert so if someone can help me to rewrite this code by using class instead of ID so that I can use multiple class. This is the code Answer I changed your code slightly. Try t…

Promise.allSettled stuck forever

I use Promise.allSettled to fetch websites in batch fashion. It works fine if I limit size of website list to 10 but it become stuck as soon as I increase it to 1000. This is weird and never happened to me. I’ve waited for three days until the script finish but it’s still stuck at the first 1000 i…

How can Promise.resolve().then execute later?

Using native Javascript Promise: This is logged: Question: how is it possible for 2 to execute before 1? JS being event-driven, what is the event that is executing the callback given to then when the original caller has already left that execution tree? Is the engine doing some kind of behind-the-scene magic …