📜  反向单词 javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:02.685000             🧑  作者: Mango

代码示例5
function reverseInPlace(str) {
  var words = [];
  words = str.match(/\S+/g);
  var result = "";
  for (var i = 0; i < words.length; i++) {
     result += words[i].split('').reverse().join('') + " ";
  }
  return result
}
console.log(reverseInPlace("abd fhe kdj"))