DEV Community 👩‍💻👨‍💻

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

Collapse
samarthtripathidesign profile image
Samarth Tripathi

function spinWords(string){
return string.split(' ').map(function(string){
return (string.length > 4) ? string.split('').reverse().join('') : string
}).join(' ');
}