Skip to content

Instantly share code, notes, and snippets.

@tomcatfever
Created January 18, 2017 03:14
Show Gist options
  • Select an option

  • Save tomcatfever/3f664ada3ba60ce394a64308926f6110 to your computer and use it in GitHub Desktop.

Select an option

Save tomcatfever/3f664ada3ba60ce394a64308926f6110 to your computer and use it in GitHub Desktop.
var myString = "Sentence to reverse";
var result = myString.split(" ").map(words => words.split("").reverse().join("")).join(" ");
// add a way to change case
console.log(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment