私は単語をループしてperticulerの文字が存在するかどうかをチェックしますが、何らかの理由でif文の条件が機能していないかどうかを確認します。JavaScriptが条件を満たしていない場合は、
Main.UpdateLetter = function(letter) {
Main.Changes = 0;
for(i = 0 ; i < Main.word.length ; i++){
Main.wordArray[i] = Main.word.charAt(i);
console.log(Main.wordArray[i]);
if ( Main.wordArray[i] == d) {
alert("found letter");
} else {
console.log("not found");
}
}
}
あなたの答えを編集し、インデントを整理してください。 – Soviut
'd'とは何ですか?どのように初期化しますか? –
私は 'Main.wordArray [i] === letter'を関数の引数を使用して比較したいと思っています... – Aprillion