Answers for "javascript reverse array and separate by spaces"

0

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);
Posted by: Guest on February-20-2021

Code answers related to "javascript reverse array and separate by spaces"

Code answers related to "Javascript"

Browse Popular Code Answers by Language