JavaScript contact manager | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

JavaScript contact manager

Please what is wrong with my code it has just been showing me no input please i need some help👇👇👇👇👇👇👇 👇👇👇👇👇👇👇👇👇👇👇👇👇 function contact(name,number){ this.name=name; this.number=number; this.print=function(){ var x=this.name; var y=this.number; console.log(x + ":" + y); } } var a=new contact ("David",12345); var b=new contact ("Amy",987654321); a.print(); b.print();

15th Jun 2021, 2:58 AM
Destiny Eliagwu Simon
Destiny Eliagwu Simon - avatar
7 Answers
+ 2
I guess you just forgot to put a space after the colon: console.log(x + ": " + y);
15th Jun 2021, 3:04 AM
visph
visph - avatar
+ 1
(inside the quotes)
15th Jun 2021, 3:16 AM
visph
visph - avatar
0
no, not in the code provided in the description ^^
15th Jun 2021, 3:14 AM
visph
visph - avatar
0
in the console.log argument, as I write the corrected version in my first post ;)
15th Jun 2021, 3:16 AM
visph
visph - avatar
- 1
I did
15th Jun 2021, 3:13 AM
Destiny Eliagwu Simon
Destiny Eliagwu Simon - avatar
- 1
Then where visph
15th Jun 2021, 3:15 AM
Destiny Eliagwu Simon
Destiny Eliagwu Simon - avatar
- 1
Thanks i appreciate visph
15th Jun 2021, 3:27 AM
Destiny Eliagwu Simon
Destiny Eliagwu Simon - avatar