//如果有一个字符串"Rome was not built in a day" //用程序统计该字符串中字符的个数 //不允许使用字符串对象的length属性。 //期末大作业1 统计字符串字符个数 //Rome was not built in a day document.write("期末大作业1" + "<br/>"); var str = "Rome was not built in a day"; var countChar = 0; for(var ch of str){ countChar++; } document.write("字符长度:"+countChar); console.log(countChar);