Frontend Interview Questions
Frontend Interview Questions
js
CopyEdit
async function fetchData() {
const response = await fetch('url');
const data = await response.json();
console.log(data);
}
Event bubbling: Event starts from the target element and propagates up to
ancestors.
Event capturing: Event starts from the root and goes down to the target.
By default, events bubble, but you can control propagation with
event.stopPropagation() .
display: none removes the element from the layout flow (no space reserved).
visibility: hidden hides the element but keeps its space reserved.