title: Can someone explain the relationship between stringToCount and [characterPosition] using this example?
body: <p>Im a beginner going through a Javascript tutorial before doing a Java Bootcamp(wish me luck!). </p>
  
  <p>Using this code, can someone explain to me the relationship between stringToCount and [characterPosition] in the if statement?</p>
  
  <p>I understand everything else about this code, but I'm struggling to grasp how this part reads. It looks like its 'and' but that would be &amp;&amp;. With no operands between them, I just need to understand this line: if (stringToCount[characterPosition] == characterToFind).</p>
  
  <p>Thus far in my studies, I only experienced brackets[ ] being used for arrays. Is characterPosition considered an array after the loop gets created? The tutorial I'm using (Software Guild) doesn't break this detail down and I need to fully understand it prior to moving forward. </p>
  
  <p>Thanks in advance.</p>
  
  <pre><code>function countingCharacters2(stringToCount, characterToFind){
      // Let's count the number of times a character appears in a string
      // We will look at each character one-by-one with the help of a for loop
      var characterCount = 0;
      for (var characterPosition = 0; 
             characterPosition &lt; stringToCount.length; 
             characterPosition++){
          if (stringToCount[characterPosition] == characterToFind){
              characterCount++;
          }
      }
      console.log("String to search in: " + stringToCount);
      console.log("Character to find: " + characterToFind);
      console.log("Number of times the character appears: " + 
                    characterCount);
  }
  </code></pre>