What’s wrong guys?
var me={
name:‘Bruno’;
age:‘17’;
}
var myObj=newObject();
var myObj={};
myObj[“name”]=“Bruno”;
myObj[“age”]=“17”;
console.log(myObj)
};
SyntaxError: missing } after property list
What’s wrong guys?
var me={
name:‘Bruno’;
age:‘17’;
}
var myObj=newObject();
var myObj={};
myObj[“name”]=“Bruno”;
myObj[“age”]=“17”;
console.log(myObj)
};
SyntaxError: missing } after property list
Hi here the two structure of an object
var myObject = {
name: "Frank",
age: 0,
}
or
var myObject = new Object();
myObject['name'] = "Franck";
myObkect.age = 0,
this part after each propriety you should put ,
instead of ;
var me={
name:'Bruno';
age:'17';
}
then here
var myObj=newObject();
var myObj={};
myObj["name"]="Bruno";
myObj["age"]="17";
console.log(myObj)
};
here
var myObj=newObject();
put a space between new
and Object();
then you should remove this var myObj={};
becaue you dont need it, also you should remove the };
and if you want to set your age to 17 you should remove the " "
around it!