Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

381
Views
which is the outer lexical reference and callee of the class constructor?

I'm figuring out the lexical environment of the constructor in class.

class Func {
  constructor() {}
}

As far as I concerned, new Func() would call the internal method [[Construct]] which refers to Func.prototype.constructor and it points at Func at the end.

The point is, what would be the Outer Lexical Environment Reference of this constructor? and how the Execution Context goes on this?

For example, when you try to make a new Promise, an example starts like this;

const foo = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve('good');
  }, 5000);
});

new Promise() calls [[Construct]] in Promise, and it goes to Promise.prototype.constructor() which is exactly same as Promise.

At this moment, does the executed constructor behave as it is called from the global scope? It is very vague for me to figure out who's calling who.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!