Home >Web Front-end >JS Tutorial >Determining the length of a string (optimized version) Chinese takes two characters_javascript skills
I just saw the js method I wrote before: calculate the length of a string (2 characters in Chinese).
Method:
var str = '123YesYesYes';
var strArr = str.split('');
var count = 0;
for(strArr.length){ **** }
…………(No more coding, I’m tired!!)
After modification: