Hands-on practice for this lecture. Work through the exercises and quizzes to reinforce what you've learned.
Exercise 1 of 1
Four code snippets — match each to the lifecycle callback where it belongs: constructor, connectedCallback, disconnectedCallback, or attributeChangedCallback.
Match each code snippet to the callback where it should run.
this.shadow = this.attachShadow({ mode: "open" })fetch("/api/beers").then(r => r.json()).then(data => { this.items = data; })clearInterval(this._pollingInterval)if (name === "theme") this.updateTheme(newValue)Memory hook: constructor = setup, connectedCallback = mount, disconnectedCallback = cleanup, attributeChangedCallback = watch.