Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Objects are just grouping of variables
- var person = {
- 'firstName': "George",
- 'lastName': "Mauer",
- 'age': 29
- };
- // Notice the last pair doesn't get a comma.
- // You can also add properties to an object like this
- person.birthplace = "Kiev";
- // or
- person['worksIn'] = "Launchpad";
- // Objecs can be nested
- person.birthday = {
- 'month': "June",
- 'year': 1982
- };
- // You can fetch them like this
- person.firstName;
- // or
- person['firstName'];
- // It's all the same
- person.birthday.month;
Add Comment
Please, Sign In to add comment