I have asked a question about creating a method in object literal notation half hour ago. I got good answers, but something is still wrong with my code. I was told to create a new question and here it is. Please don't judge the code by the efficiency. I know that I have used many bio method three times in each object, when I could do 1 function, but I did it to understand more about objects,functions and methods.
So here is my code.
var object1 = new Object()
object1.name = "Neymar";
object1.age = 22;
object1.club = "Barca";
object1.bio = function (){
console.log(this.name +" is "+ this.age + " years old and he is playing in "+ this.club);
};
var object2 = {
name: "Fred",
age: 28,
club: "Fluminense"
bio2: function (){
console.log(this.name +" is "+ this.age + " years old and he is playing in "+ this.club);
};
};
var object3 = {
name: "Hulk",
age: 27,
club: "Zenit St. Petersburg"
bio3: function (){
console.log(this.name +" is "+ this.age + " years old and he is playing in "+ this.club);
};
};
object1.bio();
object2.bio2();
object3.bio3();
The CodeAcademy say's that } is missing on the 12th line: bio2: function (){