title: How to access the array object of audios with jQuery
body: <p>I'm trying to play a array of audio with duration. I saw some posts that the Object has no length so I decide to use Object.keys instead of for loop. But I got some error 'Cannot convert undefined or null to object' and 'sound/undefined.wav 404 (Not Found)' and 'Failed to load because no supported source was found.'. Where did I do wrong? Appreciate any helps.</p>
  
  <pre><code>&lt;button id="subBut" style=display:none onClick=""&gt;Start!!&lt;/button&gt;
  &lt;div id="audioControl"&gt;
      &lt;button id="play" style=display:none onClick=""&gt;Play!!&lt;/button&gt;
      &lt;button id="pause" style=display:none onClick=""&gt;Pause!!&lt;/button&gt;
      &lt;br&gt;
      &lt;div id="counDownTimer" style=dispaly:none&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
      $("#enterVariables").on("click", function() {
          $('#enterVariables').hide();
          startBut.show();
          $("#pause").hide();
      });
  &lt;/button&gt;
  
  var playList = [{"duration": 5000, "value": "0_silence"},{"duration":5000, "value": "1_hello"}, {"duration": 5000, "value": "2_how_old"}];
  $(document).ready(function() {
     $("#play").on("click", function(){
  
                      playAudio(playList);
                      function playAudio(playList) {
                          playNextNote(playList);
                          function playNextNote(playList) {
                                  var i = 0;
  
                                  var playListKeys = Object.keys(playList);
                                  if (i &lt; playListKeys.length) {
                                  //for (i in playList){
                                          var value = playListKeys[i].value;
  
                                          var audioElement = document.createElement('audio');
                                          audioElement.setAttribute('src', 'sound/'+ value + '.wav');
  
                                          audioElement.play();
                                          i++;
                                          setTimeout(playNextNote, playListKeys.duration);
                                      }
                              }
                          };
                      });
   });
  </code></pre>