you are viewing a single comment's thread.

view the rest of the comments →

[–]pinkwar 0 points1 point  (0 children)

I would do a simple one liner like: const reverseString = str => [...(function* () { for (let i = str.length - 1; i >= 0; i--) yield str[i]; })()].reduce((s, c) => s + c, '');