How to update DOM during a async call
问题 If I have a async function as below async function predict_from_model() { $("#loading").html("first update") const model = await tf.loadModel('model.json'); $("#loading").html("second update") //doesn't happen for (var i = 0; i < 100; i++) { const model = await tf.loadModel('model.json'); $("#loading").html("more updates") //doesn't happen } ... <more code> ... } the second and third update don't happen until after the entire code block is completed. I saw online that it would be possible to