#Day59 of #100DaysOfCode
Another long day and I am glad to finish the last offsite day. It was nice meeting everybody but being the only person from my own team dint feel too great and I cant wait to be back home tomorrow 
Some sneak peek of the fun evening 
Today I finished the Objects topic and some review notes as below:
-
Objects store collections of key-value pairs.
-
Each key-value pair is a property—when a property is a function it is known as a method.
-
An object literal is composed of comma-separated key-value pairs surrounded by curly braces.
-
You can access, add or edit a property within an object by using dot notation or bracket notation.
-
We can add methods to our object literals using key-value syntax with anonymous function expressions as values or by using the new ES6 method syntax.
-
We can navigate complex, nested objects by chaining operators.
-
Objects are mutable—we can change their properties even when they’re declared with
const. -
Objects are passed by reference— when we make changes to an object passed into a function, those changes are permanent.
-
We can iterate through objects using the
For...insyntax.
Looping Through Nested Objects
let spaceship = {
crew: {
captain: {
name: 'Lily',
degree: 'Computer Engineering',
cheerTeam() { console.log('You got this!') }
},
'chief officer': {
name: 'Dan',
degree: 'Aerospace Engineering',
agree() { console.log('I agree, captain!') }
},
medic: {
name: 'Clementine',
degree: 'Physics',
announce() { console.log(`Jets on!`) } },
translator: {
name: 'Shauna',
degree: 'Conservation Science',
powerFuel() { console.log('The tank is full!') }
}
}
};
// for...in
for (let crewMember in spaceship.crew) {
console.log(`${crewMember}: ${spaceship.crew[crewMember].name}`);
}
