Why does Bootstrap 4 use private methods in es6 classes?
<p>I was looking inside the source code of Bootstrap 4, and I discovered they're using es6 classes coupled with some revealing module pattern of some sort. </p>

<p>Here is a simplified example of code taken from <a href="https://github.com/twbs/bootstrap/blob/v4-dev/js/src/modal.js" rel="nofollow">here</a>.</p>

<pre><code>const Modal = (($) =&gt; {


  const NAME                         = 'modal'
  const VERSION                      = '4.0.0-alpha.3'
  ...

  const Default = {
    ...
  }


  class Modal {

    constructor(element, config) {
      this._config              = this._getConfig(config)
      this._element             = element
      ...
    }


    // public

    toggle(relatedTarget) {
      ...
    }

    show(relatedTarget) {
      ...
    }

    hide(event) {
      ...
    }

    dispose() {
      ...
    }


    // private

    _getConfig(config) {
      ...
    }

    _showElement(relatedTarget) {
      ...
    }

    _enforceFocus() {
      ...
    }

    _setEscapeEvent() {
      ...
    }

    _setResizeEvent() {
      ...
    }

  }

  return Modal

})(jQuery)

export default Modal
</code></pre>

<p>This would result in every method or property being exposed, including the private ones. However, this does not happen in the final product. For example, something like <code>$('#myModal').modal('_getConfig')</code> would not work. What is happening?</p>