JSFiddle - React, Tailwind, and code Playground
JavaScript
function log(x) { document.body.innerHTML += x+"<br/>" }
function binConcat(){
var str = "", ssize = 0;
for(var i=0; i<1000000; i++) { str = str+"a"; ssize+=str.length; }
log("Total length of all created strings: "+ssize+" bytes");
}
var time = Date.now();
binConcat();
log("binConcat time: "+(Date.now()-time));