I understand that JavaScript is a single-threaded language but I was wondering if there is any way to stop the execution of a long task if it`s taking too long.
I am work