I was asked this question during an interview and had to solve it using JavaScript. The solution is actually very simple if you know the array and string funcitons.
var str = "This is a simple sentence";
var reverseStr = str.split(" ").map(e=>[...e].reverse().join("")).join(" ")
console.log(reverseStr);
//Output: sihT si a elpmis ecnetnes
Disclaimer: I know this is not an optimal solution, but the interviewer will be impressed that you were able to solve it in a single line.
Hope this helps.