ES proposal: private class fields

By Dr. Axel Rauschmayer

This blog post is part of a series on new members in bodies of class definitions:

  1. Public class fields
  2. Private class fields
  3. Private methods and getter/setters for JavaScript classes

This series replaces 2ality’s prior blog post on fields.


In this post, we look at private fields, a new kind of private slot in instances and classes. This feature is part of the ES proposal “Class field declarations for JavaScript” by Daniel Ehrenberg and Jeff Morrison.

Source:: 2ality