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

134
Views
Cómo extender la propiedad de un padre en un hijo

Tengo el siguiente código:

 class Table { get pagination () { return { get item () { return { log (s : string) { console.log(s); } } } } } } class TableWithFirst extends Table { get pagination () { return { ...super.pagination, get first () { this.item.log("first"); return "first"; } } } } const t = new TableWithFirst(); t.pagination.first

y con este código, me sale el siguiente error:

 [ERR]: "Executed JavaScript Failed:" [ERR]: Cannot read properties of undefined (reading 'log')

¿Cómo agrego el first getter a la pagination ? ¿Mover esa lógica a una clase es la única forma?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Si no necesita admitir navegadores más antiguos, puede cambiar el objetivo de compilación a ES2018 (o superior) para que la sintaxis extendida no se transpile.

Patio de juegos


Con respecto a TestCafe, aquí puede encontrar cómo personalizar las opciones del compilador TypeScript utilizadas por su corredor (no recogerá el archivo tsconfig estándar).

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!