0
2nd part outputs 3131
why
3 Respuestas
+ 4
Okay, I didn't find anything under the "2nd part", but the first section under Objects, third panel, then "Try It Yourself" + copy/pasting:
========================
var person = {
name: "John", age: 31,
favColor: "green", height: 183
};
var x = person.age;
var y = person['age'];
document.write(x);
document.write(y);
========================
The object "person" has 4 properties: name, age, favColor and height.
You can refer to string properties as a dotted property:
person.age
or an array index:
person["age"]
Both are the same thing, and each prints "31". Since no "<br />" is sent, they are printed immediately adjacent to each other, for "3131"
+ 3
I didn't realize you meant the lessons for a few minutes; instead I went searching around your profile for context.
The objects lesson has 25 panels ... I think you mean the second set of lessons so I'll go load that / see what I can figure out.
0
ok thx