0
Why Error is here? What this Error mean?
I am practicing with oop in js but here output is correct but with Error. I need to know why Error here and how to fix it. https://code.sololearn.com/WKodBNwdvh8d/?ref=app
2 Answers
+ 2
Calling your class Object is not a good idea since it's a built in keyword in javascript and this was causing some confusion.
also, the line this.result() = result; is incorrect, you do not need to declare functions in the constructor.
I fixed your code in here, I hope this helps :)
https://code.sololearn.com/WmqP979IR6ow/?ref=app
+ 4
It's your line with this.result. You can comment it out.