0

Constructor shows undefined output ?

In contact manager app output is displayed but undefined is mentioned.

9th Dec 2020, 8:56 PM
Mehak Tufail
Mehak Tufail - avatar
4 Respuestas
0
Javascript
9th Dec 2020, 10:26 PM
Mehak Tufail
Mehak Tufail - avatar
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());
9th Dec 2020, 10:27 PM
Mehak Tufail
Mehak Tufail - avatar
En tendencia hoy
.
1 Votes
What?
0 Votes
HTML
0 Votes
Web
0 Votes
Quiz duel
0 Votes
FRC Coding?
1 Votes
AI
2 Votes
help
0 Votes
APIs
1 Votes