title: Javascript get each value based on pray_name
body: <p>I have data on table like this:</p>
  
  <pre><code>pray_name | time_before_iqamah
  Subuh     | 1
  Dhuhur    | 10
  Ashar     | 10
  Maghrib   | 10
  Isya      | 10
  </code></pre>
  
  <p>And I generate it to PHP jSon</p>
  
  <pre><code>$qPray = mysqli_query($con, "SELECT * FROM tb_prays WHERE active = 'Y'");
  while($dPray = mysqli_fetch_array($qPray))
  {
      $timeBeforeIqamah[] = $dPray['time_before_iqamah'];
  }
  </code></pre>
  
  <p>jSon Result</p>
  
  <pre><code>{"timeBeforeIqamah":["1","10","10","10","10"]}
  </code></pre>
  
  <p>And now I want to get <code>timeBeforeIqamah</code> based on pray name on JS.</p>
  
  <pre><code>var list = ["Imsak", "Subuh", "Terbit", "Dhuhur", "Ashar", "Maghrib", "Isya"];
  var times = prayTimes.getTimes(date, geo, timezone);
  
  for(var i in list)
  {
      if(jsonStr.currentTime == times[list[i].toLowerCase()] + ":00")
      {
          if(list[i] == "Imsak" || list[i] == "Terbit")
          {}
          else
          {
              alert(jsonStr.timeBeforeIqamah[i]);
          }
      }
  }
  </code></pre>
  
  <p>Assume We are on <code>Subuh</code> time means what I'm trying to <code>alert(jsonStr.timeBeforeIqamah[i]);</code> should be get value: <code>1</code>, but What I got is: <code>10</code></p>
  
  <p>What I want is get <code>time_before_iqamah</code> base on pray name on JS.</p>
  
  <p>How to do that?</p>