- 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
Cyber DeCypher 🐎
Cyber DeCypher 🐎 - avatar
7 Réponses
+ 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
Cyber DeCypher 🐎
Cyber DeCypher 🐎 - avatar
- 1
Then where visph
15th Jun 2021, 3:15 AM
Cyber DeCypher 🐎
Cyber DeCypher 🐎 - avatar
- 1
Thanks i appreciate visph
15th Jun 2021, 3:27 AM
Cyber DeCypher 🐎
Cyber DeCypher 🐎 - avatar