var str ="Rome was not built in a day"; var sum =0; for(var i of str) { sum++; } document.write(sum);