+ 1
It's giving problem.please help
You are working on a Contact Manager app. You have created the contact object constructor, which has two arguments, name and number. You need to add a print() method to the object, which will output the contact data to the console in the following format: name: number The given code declares two objects and calls their print() methods. Complete the code by defining the print() method for the objects. function contact(name, number) { this.name = name; this.number = number; this.print = function() { var x = this.name; var y = this.number; console.log(x+":"+y); } } var a = new contact("David", 12345); var b = new contact("Amy", 987654321) a.print(); b.print();
5 odpowiedzi
+ 6
Sathe Prerana Satish
I think there will be space after colon( : )
Check test cases output again
+ 4
Please avoid posting duplicate questions
https://www.sololearn.com/Discuss/2688959/?ref=app
+ 2
what's your problem?
coz this code works as expected ^^
0
Ok I'll try
0
Wait