javascript reverse array and separate by spaces code example
Example: 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);