who triggers the event loop? Who owns the event loop?
JavaScript Engine(e.g. V8 in Chrome) contains event loop. The event loop got its name because of how it is usually implemented, which usually resembles:
while(queue.waitForMessage()){
queue.processNextMessage();
}
queue.waitForMessage synchronously awaits the arrival of a message if it is not currently available.
Is the thread start loop the same JS thread that is single-threaded and executes JS code?
JavaScript is that single-threaded, at run time, there is only one thread (the JavaScript engine) that contains event loop.
, ? , , , ?
, JavaScript. , , , JavaScript.
, , JavaScript Engine.
function init() {
var link = document.getElementById("foo");
link.addEventListener("click", function changeColor() {
this.style.color = "burlywood";
});
}
init();

(: carbonfive.com)
:
http://altitudelabs.com/blog/what-is-the-javascript-event-loop/
http://blog.carbonfive.com/2013/10/27/the-javascript-event-loop-explained/