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();
2 Réponses
+ 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