DEV Community

loading...

Discussion on: Interview Qs Decoded - # 2

Collapse
htshah profile image
Het Shah

Or not so optimized but shorter code:

const reverse2 = ([...str]) => 
    str.map((ch,i)=>str[str.length-1-i]).join('');