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

130
Views
objeto enlazado de registro js

Tengo una función vinculada a un objeto, ¿cómo puedo acceder al objeto en el mismo ámbito que la función?

 let f = function(){}; class A{} f = f.bind(new A()); // console.log(f.bindedObject)

¿Qué pasa en un método?

 class B{ constructor(func){ this.func = func; } log(){ // console.log(this.func.bindedObject) } } class A{} let b = new B(function(){}.bind(new A())); b.log()
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Podrías sobrescribir el método de bind

 (function() { let bind = Function.prototype.bind; Function.prototype.bind = function(newThis) { let bf = bind.apply(this, arguments); bf.newThis = newThis; return bf; }; })(); var f = function() {}; var nf = f.bind({'hello':1}); console.log('newThis', nf.newThis);

about 4 years ago · Juan Pablo Isaza Report
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!