Get the number of Unicode code points in input, unlike string.length which counts UTF-16 code units.
input
string.length
codePointLength('hello'); // 5codePointLength('😀'); // 1'😀'.length; // 2 Copy
codePointLength('hello'); // 5codePointLength('😀'); // 1'😀'.length; // 2
Get the number of Unicode code points in
input, unlikestring.lengthwhich counts UTF-16 code units.