After giving the input why it shows error?
I know the right answer of js problem contact manager is :- 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(); But, If i write :- Function contact(name,number){ this.name = name; this.number = number; this.print = go; } Function go(){ return this.name + ":" + '\xa0' + this.number; } var a = new contact("David", 12345); var b = new contact("Amy", 987654321); Console.log(a.print()); Console.log(b.print()); This also gave the same result David : 12345 Amy : 987654321 But it shows wrong.plz tell why it shows wrong