title: jQuery / JS - Create a dynamic variable name
body: <p>I need to concatenate a dynamic variable name which I Will generate from the <strong>location.hash</strong> and other parameters. </p>
  
  <p>Trying to achieve the following</p>
  
  <pre><code>document.getElementById('rev_slider_16').scrollIntoView();
  revapi16.revshowslide('2'); 
  return false;
  </code></pre>
  
  <p>but I will get the slider/slide number like the following</p>
  
  <pre><code>function init_inpage_slide(){
      $('a[title*=slider]').click(function(e) {
          var slider = $(this).attr('title').split("slider");
          $(window).on("hashchange", function(e){
              var slide = location.hash.split("slide");
              console.log(slide[1], slider[1]);
              if($('#rev_slider_'+slider[1]).is(':visible')){
                  document.getElementById('rev_slider_'+slider[1]).scrollIntoView(); 
                  revapi16.revshowslide(slide[1]);
              }
          });
      });
  }
  </code></pre>
  
  <p>the problem is here:</p>
  
  <pre><code>revapi16.revshowslide(slide[1]);
  </code></pre>
  
  <p>where <code>revapi16</code> is specific to the slider 16. What I need is to use something dynamic which will be generated from the function above:</p>
  
  <pre><code>revapi+sliderNumber.revshowslide(slide[1]);
  </code></pre>
  
  <p>Is there a way?</p>