function contact(name, number) { this.name = name; this.number = number; this.print= function(){ console.log(name,":",number) } } var a = new contact("David", 12345); var b = new contact("Amy", 987654321); a.print(); b.print();
4/10/2021 5:16:32 AM
Harshita Kumari2 Answers
New AnswerIf you need output without any space console.log(name,":",number) Replace with console.log(name+":"+number)
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message