Can anyone help to remove space from my code | Sololearn: Learn to code for FREE!

0

Can anyone help to remove space from my code

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 Kumari

2 Answers

New Answer

+4

If you need output without any space console.log(name,":",number) Replace with console.log(name+":"+number)

+2

You can use + instead of , like name + "brooh "+ other_name