JavaScript for Developers 40 - Exercise Solution

preview_player
Показать описание

I'll now walk you through the solution to the code exercise in the previous video.
Рекомендации по теме
Комментарии
Автор

there's no need in parenthesis in the return expression, you can just

return this.address.state === state;

eliyahushvalb
Автор

Ha, I mostly never do these exercises but did this one today. Felt more pride in having done a 2 minute solution correctly comapred to the pride I feel in my job as a developer!

ron
Автор

There's no need to define the object's property name as a string.

HamidBehnam
Автор

Hello Guys, any one can explain this

var person2 = person;
person={};
person2.address2 = person2.address;
person2.address ={};

what will be happen for this?

naveenkumar-bzrg
Автор

```let person = {
firstName: 'John',
lastName: 'Doe',
getFullName: function () {
return this.firstName + ' ' + this.lastName;
},
address: {
street: '123 js street',
City: 'js',
state: 'CA',
isFromState: function (state) {
return (this.state === state);
}
}
}

AirborneTravellerHere