SOURCE

function fun (str){
    let bytes = str.length
    for(let i = 0; i<str.length; i++){
        if(str.charCodeAt(i)>225){
            bytes++;
        }
    }
    return bytes;
}
console.log(fun('你好,hello'))
console 命令行工具 X clear

                    
>
console