title: How to reverse a string in place without reversing the punctuation?
body: <p>I am trying to reverse the words in a string without any effect on punctuation.<br>
  This is my current code:</p>
  
  <pre><code>function reverse(str) {
      str = str.split("").reverse().join("");
      str = str.split(" ").reverse().join(" ");
      console.log(str)
  }; 
  
  reverse("This is fun, hopefully.")
  </code></pre>
  
  <p>The result of the above function is <code>sihT si ,nuf .yllufepoh</code><br>
  while I am trying to to get it like <code>sihT si nuf, yllufepoh.</code></p>