I'm writing a javascript function to update elements on a page in discrete time steps. When I call it though, the browser does not update those changes until the entire function is executed.

Is there a line of code I could easily insert into my loop that will get the browser to update the page at each time step?