문제 링크 : Decode the Message
/**
* @param {string} key
* @param {string} message
* @return {string}
*/
var decodeMessage = function(key, message) {
let result = ''
key = [...new Set(key.split(' ').join(''))]
const alphabet = 'abcdefghijklmnopqrstuvwxyz'
for(let al of message) {
result += alphabet[key.indexOf(al)] ?? ' '
}
return result
};