title: Frist for loop of chechletter function is not looping
body: <p>I get 2 warnings: -'for' statemtn doesn't loop
  - variable might not have been intitialzed
  Both warning are from the line of first for loop statement</p>
  <p>the code is supposed to be the game 'lingo'. ik coded it mysels but i am not that good at javascript and ran in to some trouble.
  the for loop of the checkletter function needs to check how much the letter occurs in the word.however the first for loop won't loop bescause of its statement, i do not know what to do.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>/*Rij met woorden*/
  const arrayWords = ["artist",
  "bridge",
  "global",
  "apples"]
  
  /*Random woord kiezen uit de rij (het woord dat geraden moet worden*/
  let word = arrayWords [Math.floor(Math.random() * arrayWords.length)];
  console.log(word);
  let count1 = 0;
  let count2 = 0;
  
  
  /*Wanner op enter geduwd wordt, wordt het ingetypte woord bewaard*/
  let input = document.getElementById("input");
  input.addEventListener("keyup", function(event) {
      if (event.code === 'Enter') {
          event.preventDefault();
          saveWord();
      }
  })
  
  function saveWord() {
      let userWord = document.getElementById("input").value;
      let userWordDelete = document.getElementById("input");
      userWordDelete.value = "";
      document.getElementById("error").innerHTML = "";
  
      /*Het getypte woord in de boxen steken*/
      if (userWord.length === 6) {
          for (;count1 &lt; 6; count1++, count2++){
              document.getElementById("box"+count2).innerHTML = userWord[count1];
          }
          checkWord(userWord);
      }else {
          document.getElementById("error").innerHTML = "U heeft geen woord van 6 letters ingegeven, probeer opnieuw!";
      }
  }
  
  
  /*Controle ingetypte woord met het te raden woord*/
  function checkWord(guessedWord) {
      count1 = 0;
      let count3 = 0;
  
      /*Kijkt of de letter de juiste is en de juiste plaats heeft*/
      for (let i = 0; i &lt; guessedWord.length; i++){
          if (guessedWord[i] === word[i]){
              document.getElementById("box"+(i+count2-6)).style.backgroundColor = 'green';
              count3++;
          }else{
              document.getElementById("box"+(i+count2-6)).style.backgroundColor = checkLetter(guessedWord[i],guessedWord);
          }
      }
  
      if (count3 === 6) {
          document.getElementById("error").innerHTML = "You guessed the word, congratulations!";
  
      }
  
      if ((count2 &gt; 55) &amp;&amp; (guessedWord !== word)){
          document.getElementById("error").innerHTML = "You lost, try again!";
      }
  }
  
  /*Kijkt of de letter de juiste is maar op verkeerde plaats, en of deze al dan niet geel moet worden*/
  function checkLetter(letter, guessedWord) {
      if (word.includes(letter)) {
          let count4 = 0;
          let count5 = 0;
  
          /*Kijken hoeveel keer de letter voorkomt in het te raden woord*/
          for (let j = 0; j &lt; 6; j++) {
              if (letter.localeCompare(word[j]) === 0) {
                  count4++;
              }
              console.log("count4= " + count4);
  
              /*Kijken hoeveel keer letter voorkomt in het gegeven woord voor de letter die we aan het controleren zijn*/
              for (let z = 0; z &lt; j; z++) {
                  if (letter.localeCompare(guessedWord[z]) === 0) {
                      count5++;
                  }
              }
              console.log("count5= " + count5);
  
              if (count5 &lt; count4) {
                  return 'yellow';
              } else {
                  return 'transparent';
              }
          }
      }else {
          return 'transparent';
      }
  }</code></pre>
  </div>
  </div>
  </p>