I\'ve got a doubt regarding performance in JS.
Say, I\'ve got the next code:
var divContainer = document.createElement(\"div\"); divContainer.id=\"co
In my experience dom operations usually happen only after call stack is empty. If I put lot of dom operations in the loop, browser just freezes for some time and then displays everything at once. You can break the stack by using setTimeout to display result more frequently if you want. For this reason I believe that both methods should perform similarly. This is actually very strange sometimes, because if in one stack you change some element you will never see its state before the change (had this problem with progress notification object which innerHTML was never updated during the loop - just starting status and then final).