Below is my code:
const list = document.createElement("ul");
document.body.append(list);
for(let i=0; i<100000; i++){
let num = document.createElement("li");
num.textContent = "This is " + i;
list.append(num);
}
When I run this code, I see that the browser window is blank and shows as loading in the tab for few seconds, and then all the list elements are displayed at once. I want them to display one by one as they are being created rather than all at once. Is it possible to achieve this? Note that I have used a huge number in the loop so that I can observe the effect easily.