Get Private vs Public properties

Benchmark created on


Setup

class C {
  #priv = 1;
  pub = 1;
  getPriv() {
    return this.#priv;
  }
  getPub() {
    return this.pub;
  }
}

Test runner

Ready to run.

Testing in
TestOps/sec
get private prop
const c = new C;
c.getPriv();
ready
get public prop
const c = new C;
c.getPub();
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.