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);
2 Answers
+ 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 .
+ 1
thank you.