re: How to reverse a string in JavaScript VIEW POST

FULL DISCUSSION
 

Recursion:

const r = ([h,...t],o='')=>h?r(t,h+o):o; r('hello')

Recursion if we don't care about TCO:

const r = ([h,...t])=>h?r(t)+h:''; r('hello')
code of conduct - report abuse