The following snippet of code freezes the CSS animation until it is done. I can't figure out why. I tried promises, async await, setTimeout, nothing changed. I want to have nice and simple loading animation to show in the browser while the following snippet of code does its stuff behind the scenes. But it freezes my animation. What should I do?
sortedByFrequency is an object that contains large amount of word-properties which have digit values. The following methods sort properties inside the object highest value)
const sortedByFrequency = Object.entries(dictionary)
.sort(([, v1], [, v2]) => v2 - v1)
.reduce((obj, [k, v]) => ({
...obj,
[k]: v
}), {})