<my-ce></my-ce>

<script>
  class MyCe extends HTMLElement {
    constructor() {
      super()
      this._name = 'Default Name'
    }

    get name() {
      return this._name
    }

    set name(value) {
      this._name = value
    }
  }
  customElements.define('my-ce', MyCe)
</script>

Define getter method

A getter method for the name property is defined to return the value of _name.