0

Content Manager JavaScript?

Problem Content Manager JavaScript

14th Mar 2021, 9:14 PM
Jonathan
6 odpowiedzi
+ 2
Jonathan You need to close brackets after console.log(x + ": " + y);
14th Mar 2021, 9:36 PM
A͢J
A͢J - avatar
+ 1
Jonathan You missed one closing brackets of function this.print and also there should be space after colon (:) not before colon (:)
14th Mar 2021, 9:25 PM
A͢J
A͢J - avatar
+ 1
I Am AJ ! Thanks AJ! Appreciate it! Stupid of me haha!
14th Mar 2021, 9:40 PM
Jonathan
0
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();
14th Mar 2021, 9:14 PM
Jonathan
0
What am I doing wrong?
14th Mar 2021, 9:15 PM
Jonathan
0
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(); I Am AJ ! Like this? It still doesn't work
14th Mar 2021, 9:33 PM
Jonathan