Categories
Javascript

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:

By Arjun

I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.

Leave a Reply

Your email address will not be published. Required fields are marked *