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

144
Views
Por alguna razón me está dando indefinido indefinido indefinido en este código

 class cars { construtor(name, color, type) { this.name = name; this.color = color; this.type = type; } brand(br) { console.log(this.name + " " + this.color + " " + this.type) } } const type1 = new cars("ferrari", "red", "Automatic"); console.log(type1) type1.brand() class cars2 extends cars { ask(text) { this.brand(text) } } const type2 = new cars2("BMW", "Blue", "Automatic") type2.ask()

así que quería que diera las siguientes cosas que escribí en consts pero me da indefinido 3 veces en ambos.

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

0

Simplemente está mal construtor constructor debería ser constructor

 class cars { constructor(name, color, type) { this.name = name; this.color = color; this.type = type; } brand(br) { console.log(this.name + " " + this.color + " " + this.type) } } const type1 = new cars("ferrari", "red", "Automatic"); console.log(type1) type1.brand() class cars2 extends cars { constructor(name, color, type) { super(name, color, type); } ask(text) { this.brand(text) } } const type2 = new cars2("BMW", "Blue", "Automatic") type2.ask()

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!