I made this benchmark here: https://jsperf.com/ways-to-get-a-random-string
And I lack the formal knowledge to understand why the Array.from version is about 25% as fast as the while loop version, being that they intuitively should do something similar.
Can you please help me understand?
Remember this: Compiler optimizations are very unreliable, small innocuous changes in code can get huge effects on performance.
Edit: Just looked at the code in the link, and Array.from is not the only difference, the other code uses string concatenation instead of array concatenation. Appending to a string in Javascript is typically a lot faster than appending to an array.