function removeCommonLetters(word1, word2) {
let result = '';
for (const char of word1) {
if (!word2.includes(char)) {
result += char;
}
}
return result;
}
// You can export the function if you want to use it as a module
module.exports = removeCommonLetters;
const word1 = "forest";
const word2 = "tor";
const result = removeCommonLetters(word1, word2);
console.log(result);
/*
run:
fes
*/