Js object module project help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Js object module project help

I don't understand why this code doesn't work - even outside the test cases - I need help in solving this project problem which is out putting the name: number using the method "print" of the contact object , thanks in advance. https://code.sololearn.com/cF8Fo188FHvD/?ref=app

11th Jan 2021, 7:39 PM
Manar Ahmed
Manar Ahmed - avatar
4 Answers
+ 1
Put one of these } on line 6 your welcome 😉
11th Jan 2021, 7:42 PM
D_Stark
D_Stark - avatar
+ 1
Oh my god what a simple mistake ! 😂 thanks a lot😇
11th Jan 2021, 7:43 PM
Manar Ahmed
Manar Ahmed - avatar
+ 1
Manar Ahmed haha no problem, I guarantee every programmer has done this 😁
11th Jan 2021, 7:46 PM
D_Stark
D_Stark - avatar
0
function contact(name, number) { this.name = name; this.number = number; this.sara= function() { console.log(name,":", number); } this.name = name; this.number= number; this.bahri = function() { console.log(name,":", number); } } var a = new contact("David", 12345); var b = new contact("Amy", 987654321); a.sara(); b.bahri(); the same output but still false!
20th Feb 2022, 6:29 PM
Sara Bahri
Sara Bahri - avatar