Skip to content

Instantly share code, notes, and snippets.

View pangiole's full-sized avatar
🏠
Working from home

Paolo Angioletti pangiole

🏠
Working from home
View GitHub Profile

Private members in ES6 classes

"Let's create an ES6 class!" you say. "Let's give it a private variable x."

class Foo {
  constructor(x) {
    this.x = x;
  }
  getX() {