title: JavaScript dynamic variable in for loop
body: <p>I need to create some rules in javascript as below. I want to do create these rules in for loop however I couldn't able to dynamically create the variable parts.</p>
  
  <pre><code>var _docmap = document.mappingsTanimlari;
      if(_docmap.addServerOrClusterValue0.value != ""){
          arr.push(_docmap.addServerOrCluster0.value + _docmap.addServerOrClusterValue0.value)
      }
      if(_docmap.addServerOrClusterValue1.value != ""){
          arr.push(_docmap.addServerOrCluster1.value + _docmap.addServerOrClusterValue1.value)
      }
      if(_docmap.addServerOrClusterValue2.value != ""){
          arr.push(_docmap.addServerOrCluster2.value + _docmap.addServerOrClusterValue2.value)
      }
      if(_docmap.addServerOrClusterValue3.value != ""){
          arr.push(_docmap.addServerOrCluster3.value + _docmap.addServerOrClusterValue3.value)
      }
      if(_docmap.addServerOrClusterValue4.value != ""){
          arr.push(_docmap.addServerOrCluster4.value + _docmap.addServerOrClusterValue4.value)
      }
  </code></pre>