45
rated 0 times
[
46]
[
1]
/ answers: 1 / hits: 23577
/ 9 Years ago, thu, january 21, 2016, 12:00:00
Looked around and could not find an answer for this one.
I am trying to reverse each word of a string without changing the order of the words...
this is the code I have:
function wordsReverser(string){
return string.split('').reverse().join('');
}
console.log(wordsReverser('New string, same results.'));
what I am getting for results is this:
.stluser emas ,gnirts weN
I am looking for this:
weN gnirts...
Here is a jsbin
More From » arrays