Javascript Loop Through Array From Asynchronous Programming Techniques