Web Components & Shadow DOM

What is the correct way to define a custom element?
class MyElement extends HTMLElement {
  constructor() {
    super();
    // Custom element logic
  }
}
customElements.define('my-element', MyElement);
Next Question (2/20)