DEV Community

Discussion on: Best practices for reversing a string in JavaScript, C++ & Python

Collapse
 
mse99 profile image
Mohamed Edrah • Edited

In JavaScript it's better to use Array.from() to cast the string into an array instead of split, .from uses the string iterator which takes into account surrogate pairs .split does not.

cheers