No benchmarks for the Unicode methods, which I suspect would be the desired results... The format of the article seems to spend too much effort on getting the byte length of a string, which is not the characters in a string.
> Using the split() method
> let characters = message.split('');
> console.log(characters.length);
> Using the slice() method
> let characters = message.slice();
> console.log(characters.length);
Is this a joke? Or just a way to collect Medium reactions?
Definitely not a great article... as it is, the Unicode character and surrogate detection isn't great, and even then doesn't really work right with the regexp for non-unicode surrogates. The notation of byte length should probably be a blurb and jump right into the Unicode detection, surrogates being another, related issue, and even then, it's problematic at best.
Not to mention the benchmark at the end is kind of useless and doesn't include the Unicode aware methods. Also, no mention of UCS-16 vs UTF-8 or other Unicode demarkation with strings in JS.
Definitely click-bait.