SHARE
TWEET

Reverse with filter

a guest Jul 24th, 2014 233 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function reverseWordsInString(str) {
  2.     var arrWords = str.split(' ');
  3.     var newArr = arrWords.filter(function(e) { return e.split('').reverse().join('')});
  4.     //console.log("hello".split('').reverse().join(''));
  5.     console.log(newArr);
  6.  
  7. }
  8.  
  9. reverseWordsInString("Hello, how are you.");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top