SOURCE

console 命令行工具 X clear

                    
>
console
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title></title>
  </head>
  <body>
    <script>
      var str ="Rome was not built in a day";
      arr =str.replace(/\s/g);
      
      var count =0;
      for(var i of str)
      {
        count++;
      }
      document.write("字符的个数为"+count+"个");
    </script>
  </body>
</html>