0
Someone help me to find the problem?
function contact(name,number) {this.name=name; this.number=number; this.print=function(){ console.log(this.name+":"+this.number);} } var a=new contact("David",12345); var b=new contact("Amy",987654321) a.print(); b.print();
4 Réponses
+ 1
What's the problem?
Completely working code.
0
i don't now
Because the result is ERROR
0
I thing the problem in ":"
0
What are you testing this code on?
This works in SoloLearn.
Because of ":" there can be no problems.
The only thing that you did not do was put a punctuation mark at the end of the assignment to the variable "b".