Undefined Code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Undefined Code

Hey everybody, I made a code but when i run it keeps saying undefined. What's wrong with my code? You can visit it here: https://code.sololearn.com/WMg1K2nVusbz/?ref=app I'm new at coding and programming. Thank you

3rd Jun 2020, 2:57 AM
Mika The Coder
Mika The Coder - avatar
1 Answer
+ 4
Just replace y = car.carName with t.carName since t is the object you created which is a car that has an actual name As for the function car it self, it just says that a car has a name but doesn't specifically define that name
3rd Jun 2020, 3:02 AM
Ali Abdelhady
Ali Abdelhady - avatar