functionreverseWordsInString(str) {constarr= [];let word = [];for (let i =0; i <str.length; i++) {constcurr= str[i];if (curr !==' ') {word.push(curr);continue; }arr.unshift(...word);arr.unshift(curr) word = []; }if (word.length>0) arr.unshift(...word);returnarr.join('');}// Do not edit the line below.exports.reverseWordsInString = reverseWordsInString;