DEV Community

loading...

Discussion on: Daily Challenge #15 - Stop gninnipS My sdroW!

Collapse
kvharish profile image
K.V.Harish

My solution in js

const reverseWords = sentence => sentence.split(' ')
                                         .map(word => word.length > 4 ? word.split('').reverse().join('') : word)
                                         .join(' ');