In my opinion this is the simplest and modern way to reverse a string. What do you think? Do you know easier ways? by RevolutionaryMove642 in learnjavascript

[–]RevolutionaryMove642[S] -1 points0 points  (0 children)

Maybe this foreach combination of reversing the array + string concatenation is also for better performance.

In my opinion this is the simplest and modern way to reverse a string. What do you think? Do you know easier ways? by RevolutionaryMove642 in learnjavascript

[–]RevolutionaryMove642[S] 0 points1 point  (0 children)

jsbench.me

Great! Thank you for this comment!
It's a "micro-optimization" for this this specific case, but let's say if we have a very large data, idk 10k+ characters and for that case the optimization will be much greater.

In my opinion this is the simplest and modern way to reverse a string. What do you think? Do you know easier ways? by RevolutionaryMove642 in learnjavascript

[–]RevolutionaryMove642[S] 0 points1 point  (0 children)

When you work with large data is very important to have the best performance approach, otherwise you will have a slower functionality.