function removeWord(str, word) {
if (str.includes(word)) {
let tmp = word + " ";
str = str.replaceAll(tmp, "");
tmp = " " + word;
str = str.replaceAll(tmp, "");
}
return str;
}
let str = "node.js c c++ c# python rust go";
const word = "rust";
str = removeWord(str, word);
console.log(str);
/*
run:
node.js c c++ c# python go
*/