title: function doesn't loop through all index of array
body: <p>I am trying to solve the problem that finds if a word is a reserved keyword or not. Unfortunately, I am stuck at it.
  Debugging it shows that the loop isn't incrementing, but I don't know why? Also, It looks like that only the 0th index is being compared with strLowerCase. Why is it so? I am confused.</p>
  <p><strong>problem statement:</strong>
  One programming language has the following keywords that cannot be used as identifiers:
  <strong>break, case, continue, default, defer, else, for, func, goto, if, map, range, return, struct, type, var</strong></p>
  <p>Write a program to find if the given word is a keyword or not</p>
  <pre><code>function wordIsTheKey(str) {
    let strLowerCase = str.toLowerCase();
    const keywords = [
      &quot;break&quot;,
      &quot;case&quot;,
      &quot;continue&quot;,
      &quot;default&quot;,
      &quot;defer&quot;,
      &quot;else&quot;,
      &quot;for&quot;,
      &quot;func&quot;,
      &quot;goto&quot;,
      &quot;if&quot;,
      &quot;map&quot;,
      &quot;range&quot;,
      &quot;return&quot;,
      &quot;struct&quot;,
      &quot;type&quot;,
      &quot;var&quot;,
    ];
  
    keywordsLength = keywords.length;
  
    for (let i = 0; i &lt; keywordsLength; i++) {
      if (keywords[i] == strLowerCase) {
        return `${str} is a keyword`;
      } else {
        return `${str} is not a keyword`;
      }
    }
  }
  
  console.log(wordIsTheKey(&quot;defer&quot;));
  console.log(wordIsTheKey(&quot;While&quot;));
  
  </code></pre>