Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript reverse array and separate by spaces

var sentence = ['I', ' ', 'l', 'o', 'v', 'e', ' ', 'E', 'a', 'r', 't', 'h'];
    
var reversed = sentence.join('').split(' ').map(word => word.split('').reverse().join('')).join(' ').split(''); 
    
console.log(reversed);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #reverse #array #separate #spaces
ADD COMMENT
Topic
Name
3+8 =