- 1

I have error undefined console. Thanks you.

Undefined console. https://code.sololearn.com/W2C8IWM7kSsH/?ref=app

26th Jun 2021, 12:25 PM
Malick Diagne
Malick Diagne - avatar
3 odpowiedzi
+ 2
A function should return a value before output can obtain the value. return car.mileage += miles;
26th Jun 2021, 12:42 PM
Calviղ
Calviղ - avatar
0
Missing return statement. drive: function (miles) { return car.mileage += miles; }
26th Jun 2021, 12:36 PM
Jayakrishna 🇮🇳
0
Because the drive function aren't returning anything.That's why printing the function will become undefined.If you want to return the car.mileage, use return car.mileage; Here is the solution: https://code.sololearn.com/WA23A18A0A19
26th Jun 2021, 12:37 PM
The future is now thanks to science
The future is now thanks to science - avatar