0

Please, Can you help me?šŸ¤—

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

18th Apr 2022, 11:01 AM
Ahmedov Sirojiddin šŸ‡ŗšŸ‡æ
Ahmedov Sirojiddin šŸ‡ŗšŸ‡æ - avatar
3 Answers
+ 3
Re-read lesson 34 on how to add methods to an object and then show your attempt. You can put your code in a script on sololearn playground and link it: Go to Code section, click +, select web or node, insert your code and save it. Come back to the thread, click +, Insert Code. Then sort for My Code Bits and select your code.
18th Apr 2022, 11:51 AM
Lisa
Lisa - avatar
+ 2
We are supposed to write the print() method. What have you tried so far?
18th Apr 2022, 11:29 AM
Lisa
Lisa - avatar
- 2
Lisa So far I don't understand anything, can you send me your answer (code)? šŸ„²
18th Apr 2022, 11:37 AM
Ahmedov Sirojiddin šŸ‡ŗšŸ‡æ
Ahmedov Sirojiddin šŸ‡ŗšŸ‡æ - avatar