title: How do I declare and use dynamic variables in JavaScript?
body: <p>Suppose I need to declare a JavaScript variable based on a counter, how do I do so?</p>
  
  <pre><code>var pageNumber = 1;
  var "text"+pageNumber;
  </code></pre>
  
  <p>The above code does not work.</p>