8. Accessing Properties. What is wrong with the script?


#1



8. Accessing properties. It reads:

SyntaxError: Expected an identifier but found 'name1' instead

:frowning:


var bob = {
  name: "Bob Smith",
  age: 30
};
var susan = {
  name: "Susan Jordan",
  age: 25
};
var bob = {
var name1 = bob.name;
var age1 = bob.age;
};
var susan = {
var name2 = susan.name;
var age2 = susan.age;
};


#2

Hi there are two anotation for object

var Object1 = {
    name: "Franck",
    age: 0
}

or

var Object2 = new Object()
    Object2.name = "Franck";
    Objcet2.age = 0