2nd part outputs 3131 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

2nd part outputs 3131

why

2nd Sep 2017, 10:26 PM
maksim kozlov
maksim kozlov - avatar
3 Answers
+ 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"
2nd Sep 2017, 10:46 PM
Kirk Schafer
Kirk Schafer - avatar
+ 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.
2nd Sep 2017, 10:38 PM
Kirk Schafer
Kirk Schafer - avatar
0
ok thx
3rd Sep 2017, 11:35 AM
maksim kozlov
maksim kozlov - avatar