JS 5 ways to judge string length (distinguish Chinese from English)


Purpose: to calculate the length of the string (1 character in English, 2 characters in Chinese)