I wanted to understand the internal mechanisms of a JavaScript engine for asynchronous functions, so I checked the Spec. For the rest of this question, I will refer to the linked version of the specification. Section 6.2.3.1 describes this. Basically, a promise is created which is resolved to the expression that is awaited. The promise is then added resolving handlers
Tag: specifications
How to check if some DOM element in another DOM element tree?
How to check if some DOM element in another DOM element tree? For example to hide menu when you click on main page content instead of menu you can: Note that usual solution to hide menu when you click to non-menu area is event.stopPropagation() on menu and non-conditional document.addEventListener(). I make test code with iteration loop over node = node.parentNode