Pig Latin Translator Bug | JS

I am making a pig latin translator, but when you type “chess” it gives you “cesscha” instead of “esscha”, I cannot find the bug, Please help. Here is the code:

var word = "chess";
console.log(word)
if (word[0] == "c") {
  if (word[1] == "h") {
    const translate = word.replace(word[0], "") && word.replace(word[1], "") + word[0] + word[1] + "a";
    console.log(translate)
  } else {
    const translate = word.replace(word[0], "") + word[0] + "a";
    console.log(translate)
  }
} else {
    const translate = word.replace(word[0], "") + word[0] + "a";
    console.log(translate)
}

Hi there and welcome to the forum!

I have edited your post to make your code legible. If you wish to post code on the forum, please use the Preformatted Text tool (</> icon or CTRL+e) to create two sets of backticks between which you can paste your code.

What are you hoping this operator does for you here?

Add the following before this line, so you can see what the replace method is attempting to do.

console.log(word.replace(word[0], ""));