Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

205
Vistas
Everytime when i try to acces the (car1.topSpeed) in browser consol bar it shows me an error(car1 is not defined) what to do?

This is my code and everytime when I try to access the (car1.topSpeed) in browser console it shows me an error(car1 is not defined) what to do ?

//Creating a constructer for cars
function GeneralCar(givenName,givenSpeed){
    this.name = givenName;
    this.topSpeed = givenSpeed;
    this.run = function(){
        console.log(`${this.name} is running`);
    }
    this.analyze = function(){
        console.log('This car is slower by ${200 - this.topSpeed} than Mercedes')
    }
}
let car1 = new GeneralCar('Tesla',120);          //Here creating a new car with the help of the constructer(GeneralCar).
let car2 = new GeneralCar('Maruti',80);
console.log(car1,car2);

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda