Node.js 12: Private Class Fields

Javascript allows us to declare fields inside the class. We can access its own fields or properties by creating an instance of a class.

Example:

As specified as of 2019, We can now declare private fields using #. Using private fields the implementation details of a class are kept internal and are not exposed to the world.

Example:

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
DMCA.com Protection Status
0
Would love your thoughts, please comment.x
()
x