I am having a bottleneck with my sort() functions, something like:
list.sort(function (a,b) {return (a.value - b.value);});
that freezes the browser for a couple of seconds.
For the same situation with a loop it is recommended to use a "timeout" strategy, such as the one described here:
How to stop intense Javascript loop from freezing the browser
Then, the question is, can this be implemented with the sort methods?
*EDITED following the comment discussion
// main_div is a div defined before
for (let i=0; i<list.length; i++) {
main_div.appendChild(document.getElementById(list[i].id));
}