0

Проверьте код прошу.

function contact(name, number) { this.name = name; this.number = number; this.print = function (name,number){ console.log(x:y)} } var a = new contact("David", 12345); var b = new contact("Amy", 987654321) a.print(name,number); b.print(name,number);

22nd Jun 2022, 11:19 AM
Саня
2 Respostas
+ 1
i don't know what exactly you are looking to do but i corrected it a bit to make it work. 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(); Hopefully above helps , otherwise describe your problem in detail .
26th Jun 2022, 11:22 AM
Abhay
Abhay - avatar
+ 1
thank you.
26th Jun 2022, 6:48 PM
Саня