You can split a line into words and display each word by breaking it into an array of characters and cancel the array, and then join the words to one line. Like this:
string.split(' ').map(s => s.split('').reverse().join('')).join(' ')
:
string.split(' ')
, "Reverse this line" ["Reverse", "this", "line"] ( , ). , - .
, .map. , .forEach, , .map , .map. -, undefined! ES2015 + , , => {...}, return.
.map
s => s.split('').reverse().join('')
s, , , . , "Reverse" ["R", "e", "v", "e", "r", "s", "e"]. .reverse() , . ! , , .reverse() , . , . , .join('') .
, .join(' ') , , , , .join('') .