title: HangMan Guess function isn't working as desired
body: <p>My hangman guess function is acting as it shouldn't. It does what it's supposed to as it doesn't decrease when the value of guesses if guessLetter == "", but it goes down when either guessLetter is in secretWord or if it isn't. The issue is at the bottom of my code, in wordGuess() function. Please help if you can thank you. **</p>
  
  <blockquote>
    <p><strong>THIS IS THE LINK TO MY CODEPEN CODE
     <a href="https://codepen.io/MilkyBOii/pen/LyPdRp?editors=0011" rel="nofollow noreferrer">https://codepen.io/MilkyBOii/pen/LyPdRp?editors=0011</a></strong></p>
  </blockquote>
  
  <p>**</p>
  
  <pre><code>var guessWords = ["school", "test", "quiz", "pencil", "ruler", "protractor", "teacher", "homework", "science", "math", "english", "history", "language", "elective", "bully", "grades", "recess", ]
  var secretWord = guessWords[Math.floor(Math.random()*guessWords.length)];
  var wrongLetters = []
  var correctLetters = []
  var repeatLetters = []
  var guesses = Math.round((secretWord.length) + (.5*secretWord.length)) 
  function startGame() {
    var testWord = document.getElementById("randTest").innerHTML = secretWord; 
    var correctLettersOUT = "";
      document.getElementById("currentGuess").innerHTML = secretBlanks(secretWord)
      function secretBlanks(secretWord) {
        for (var i = 0; i &lt; secretWord.length; i++) {
          correctLettersOUT+=("_ ");
          } return correctLettersOUT;
  
  }}
  function correctWord() {
    var guessLetter = document.getElementById("guessLetter").value;
    document.getElementById("letter").innerHTML = guessLetter;
  
   for (var i = 0; i &lt; secretWord.length; i++) {
       if (correctLetters.indexOf(guessLetter) === -1)
  
          if (guessLetter === secretWord[i]) {
            correctLetters.push(guessLetter);
            break;
          }
   }
      if(wrongLetters.indexOf(guessLetter) === -1 &amp;&amp; correctLetters.indexOf(guessLetter) === -1) {
           wrongLetters.push(guessLetter);
      }
  
    /*console.log(correctLetters); **Used to see if the letters were added to the correct array**
    console.log(wrongLetters);*/
  wordGuess();
  }
  function wordGuess() {   
    if(guessLetter.value === ""){
      alert("You didn't guess anything.");
    }else if(guessLetter === secretWord){
      guesses = guesses + 0;
    }else {
      guesses--;
    }   
          console.log(guesses)
  }
  </code></pre>