I was wondering how I could isolate the execution of a JavaScript function to avoid the browser to break.
Example: if I want to output in console an associative array with around 10k elements, the browser would stop responding. How can I avoid that?
I was wondering how I could isolate the execution of a JavaScript function to avoid the browser to break.
Example: if I want to output in console an associative array with around 10k elements, the browser would stop responding. How can I avoid that?
The solution is a Web Worker.
A web worker is a JavaScript that runs in the background, independently of other scripts, without affecting the performance of the page. You can continue to do whatever you want: clicking, selecting things, etc., while the web worker runs in the background.