0
Q:

what does run to completion mean

RUN TO COMPLETION
once the function starts running, 
it will always run to completion before any other JS code can run.

Example:

setTimeout(function(){
    console.log("Hello World");
},1);

function foo() {
    // NOTE: don't ever do crazy long-running loops like this
    for (var i=0; i<=1E10; i++) {
        console.log(i);
    }
}

foo();
// 0..1E10
// "Hello World"
<div class="open_grepper_editor" title="Edit & Save To Grepper"></div
0

Tags

New to Communities?

Join the community