title: Uncaught ReferenceError: getDetails is not defined
body: <p>I'm trying to execute the following <code>JavaScript</code> code, but I'm getting error.</p>
  
  <pre><code>var services = [{place_id:'okkkkkk'}];
  var delay = 100;
  var nextAddress = 0;
  
  function theNext() {
    if (nextAddress &lt; services.length) {
      setTimeout('getDetails("' + services[nextAddress].place_id + '", theNext)', delay);
      nextAddress++;
    } else {
  
    }
  }
  
  
  function getDetails(address, next) {
    alert('ok');
  }
  
  
  theNext();
  </code></pre>
  
  <p>Errror: </p>
  
  <blockquote>
    <p>VM687:1 Uncaught ReferenceError: getDetails is not defined</p>
  </blockquote>
  
  <p>The function is defined and I'm not sure whats causing the problem: </p>
  
  <p><a href="https://jsfiddle.net/qmnaykqw/" rel="nofollow">https://jsfiddle.net/qmnaykqw/</a></p>