0
Constructor shows undefined output ?
In contact manager app output is displayed but undefined is mentioned.
4 ответов
0
Javascript
0
function contact(name, number){
this.name = name;
this.number = number;
this.print =output;
}
var a = new contact("David", 12345);
var b = new contact("Amy", 987654321);
function output()
{
console.log(this.name, ":",this.number);
//console.log(b.name,":",b.number);
}
console.log(a.print());
console.log(b.print());