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

128
Views
How do you dynamically add a method to an existing object when the method you want to add uses the "super" keyword in its body?

Suppose you want to add a method f() to an object myObj where f() uses the super keyword in its body. Eg:

function f() {
    return super.foo() + 10
}

myObj.foo = f

Well, this doesn't work, because f() can't be declared (since super isn't bound to anything).

Is there a way to dynamically add a method to an object when the method uses the super keyword in the method body?

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!