DEV Community

Discussion on: You Can Create Private Properties In JS (accessor pattern)

 
jpstone profile image
Justin Stone

Out of curiosity, why not just do something like:

function myCustomElement() {
  // happy closures go here

  return {
    someTypeOfMetaData,
    someUtilityFunction,
    HTMLElement,
  };
}
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
guitarino profile image
Kirill Shestakov

This won't help you create a custom element, nor register it. Read more about Web Components.