JSFiddle - React, Tailwind, and code Playground

JavaScript

var services = [{place_id:'okkkkkk'}];
var delay = 100;
var nextAddress = 0;

function theNext() {
  if (nextAddress < services.length) {
    setTimeout('getDetails("' + services[nextAddress].place_id + '", theNext)', delay);
    nextAddress++;
  } else {

  }
}


function getDetails(address, next) {
  alert('ok');
}


theNext();