til
Today I Learned melroy 1mo ago 100%

Private properties - JavaScript | MDN

developer.mozilla.org

Private properties are counterparts of the regular class properties which are public, including class fields, class methods, etc. Private properties get created by using a hash # prefix and cannot be legally referenced outside of the class. The privacy encapsulation of these class properties is enforced by JavaScript itself. The only way to access a private property is via dot notation, and you can only do so within the class that defines the private property.

1
0
Comments 0