编写一个方法,求字符串长度~~~

function num( str ){
     var num1 = str.length;
     var num2 = 0;
     for( var i = 0 ; i < num1 ; i++ ){
            if( str.charCodeAt(i)>= 10000 ){
                   num2++;
        }
    }    
      console.log( num1 + num2 );
}

  

原文地址:https://www.cnblogs.com/ting0410/p/10520771.html