ŠŸŃ€Š¾Š²ŠµŃ€ŃŒŃ‚Šµ ŠŗŠ¾Š“ ŠæрŠ¾ŃˆŃƒ. | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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
Š”Š°Š½Ń