Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

207
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda