/**
* @param {string} s
* @return {string}
*/
var reverseWords = function(s) {
let words = s.split(' ');
for(let i = 0; i < words.length; ++i){
let list = words[i].split('');
words[i] = list.reverse().join('');
}
return words.join(' ');
};
复制代码
转载于:https://juejin.im/post/5bdacf36e51d452ecf36187b