0

I need help in contact manager app JS

function contact(name, number) { this.name = name; this.number = number; } var a = new contact("David", 12345); var b = new contact("Amy", 987654321); a.print(); b.print(); 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.

15th Aug 2022, 3:26 PM
Kuro Chi
Kuro Chi - avatar
3 Réponses
0
Create a class first. Then a constructor function. Then add the method. You can Google all that.
15th Aug 2022, 3:40 PM
Mustafa A
Mustafa A - avatar
0
i got it sir thanks
15th Aug 2022, 3:42 PM
Kuro Chi
Kuro Chi - avatar
15th Aug 2022, 9:37 PM
SoloProg
SoloProg - avatar