I have an array which is filled asynchronous and contains 28 items. I want to wait until the array is filled with all items.
function checkIfFinished(){
Try:
var timeout = setInterval(function() { if(checkIfFinished()) { clearInterval(timeout); isFinished = true; } }, 100);
This will call your check-function every 100 ms until checkIfFinished() gives true back to you.