Private Methods and Fields in JavaScript Classes

Ever since classes were introduced in ECMAScript 2015 people wanted to use private methods and fields, which are well-known from programming languages like C++, PHP or Java. There is now a Stage 3 ECMAScript Proposal regarding private methods, getter/setters and fields. We’ll look at the proposed syntax — which is how you’ll (propably) write private methods and fields in future JavaScript versions — and how to achieve the same functionality with current language features.

You can support via PayPal and buy me a 🍺 or a cup o’ joe.

Manuel Wieser, BSc MA

I’m an experienced front-end developer and lead developer for cross-functional Scrum/Kanban teams. I’ve recently transitioned to engineering management, trying to make everyone on my team an even better developer than myself.

You can contact me via GitHub, Twitter or [email protected].

I’m currently working as the Head of Front-End Development for in Linz, making software that helps people find the job of their dreams.