decodeMorse = function(morseCode){
var arr = [];
morseCode.trim().split(' ').forEach(function(curr, ind) {
arr[ind] = '';
curr.split(' ').forEach(function(el) {
arr[ind] += MORSE_CODE[el];
});
});
return arr.join(' ').toUpperCase();
}
decodeMorse('.... . -.-- .--- ..- -.. .');