I need help with JavaScript Project Content Manager | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I need help with JavaScript Project Content Manager

I found help elsewhere for the code, but it still is not providing a space between the colon after the name and before the number. It comes out like this: ("David",12345) where it should be ("David", 12345) Here's my code: 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()

28th Oct 2021, 5:13 AM
Stacey Prahl
Stacey Prahl - avatar
2 Answers
+ 1
Just replace ":" with ": "
28th Oct 2021, 6:12 AM
Simon Sauter
Simon Sauter - avatar
0
thanks!
28th Oct 2021, 6:21 AM
Stacey Prahl
Stacey Prahl - avatar