this post was submitted on 16 Sep 2024
-1 points (33.3% liked)

Today I Learned

22 readers
3 users here now

Today I Learned (TIL). You learn something new every day; what did you learn today?

founded 1 year ago
MODERATORS
 

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.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here