Relative Content

Tag Archive for javascriptpromise

Why does my .then execute before the prior one is finished?

The following page fetches an array of database rows from a php page, then instantiates each row as an object.
After the rows have been instantiated and added to an array, I want to build my html table from the array of objects using the buildTable function.
However, the buildTable function executes prior to the array of objects being populated even though it is in .then.
What am I doing wrong?
Thanks,