I'm writing a small app that does some processing to an input that takes longer than a couple seconds, so I wanted to wrap the processing in a Modal, such as
function exec()
{
modal = document.getElementById("modal");
modal.style.display = "block";
// processing
modal.style.display = "none";
}
Here is the JFiddle: https://jsfiddle.net/6mufcet3/4/
From what I've read, Javascript is a synchronous language, but through some debugging it looks like it jumps straight to the for loop without showing the modal.
Also, if I set breakpoints in my browser's dev tools, it seems to work perfectly fine. I'm not a web developer and therefore don't really know how Javascript is executed; if things are being rearranged, etc.