JSFiddle - React, Tailwind, and code Playground

by wbednarski

JavaScript

var numDivs = 10000,
    fragment = document.createDocumentFragment(),
    startTime = new Date();

while(numDivs--){
    var newDiv = document.createElement('div');
    
    newDiv.innerHTML = 'Actually, the DOM is fast.';

    fragment.appendChild(newDiv);
}

document.body.appendChild(fragment);

alert(new Date() - startTime);