Skip to content
Advertisement

Tag: event-handling

What does it mean by “message queue” in this link?

I was trying to understand what’s an event loop in JavaScript. Came across Mozilla Developer Network’s link about event loop. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/EventLoop It mentions Queue A JavaScript runtime contains a message queue, which is a list of messages to be processed. To each message is associated a function. When the stack is empty, a message is taken out of the queue

When is an event.target.value not a string?

I came accross value = String(event.target.value || “”) when a textinputs keyup/keydown event is fired. But i’m not sure when the event.target.value is not a string? Is this possible? When is something else passed off as an event.target.value? Answer If the event.target element is not an input type element, it will not have a value property. For example, if I

Advertisement