1
00:00:00,270 --> 00:00:05,400
Before I tell you the objective for this video, let me ask you this question.

2
00:00:05,820 --> 00:00:10,320
Let's say that I'm the owner of my company.

3
00:00:11,030 --> 00:00:13,280
And then you are the employee.

4
00:00:14,200 --> 00:00:14,560
Right.

5
00:00:14,560 --> 00:00:19,930
And then I ask you that now we have this person details here.

6
00:00:20,820 --> 00:00:22,440
I can ask you that, please.

7
00:00:23,420 --> 00:00:30,620
Go to the person's record and then just print me out the name only of the person.

8
00:00:30,710 --> 00:00:32,570
How am I going to do it?

9
00:00:32,780 --> 00:00:38,580
And this is what you call accessing object properties.

10
00:00:38,600 --> 00:00:39,120
Perfect.

11
00:00:39,140 --> 00:00:44,330
So this section is all about accessing object properties.

12
00:00:44,330 --> 00:00:46,370
And how can we do that?

13
00:00:47,030 --> 00:00:47,660
So.

14
00:00:47,660 --> 00:00:55,790
So accessing object properties simply means that pulling out the values you need from from an object.

15
00:00:56,000 --> 00:01:04,730
And that is all getting the properties you want from an object is called the accessing property names.

16
00:01:04,970 --> 00:01:06,770
So come down here.

17
00:01:06,800 --> 00:01:10,070
Nice command as accessing.

18
00:01:11,990 --> 00:01:13,070
Property objects.

19
00:01:13,100 --> 00:01:14,060
Object properties?

20
00:01:14,060 --> 00:01:14,510
Yeah.

21
00:01:15,860 --> 00:01:17,420
Object properties.

22
00:01:18,440 --> 00:01:19,180
Yes.

23
00:01:19,670 --> 00:01:20,300
Yes.

24
00:01:20,330 --> 00:01:20,930
Good.

25
00:01:21,050 --> 00:01:23,320
So we have two ways of doing this.

26
00:01:23,330 --> 00:01:25,500
So let me bring this one here.

27
00:01:26,210 --> 00:01:27,560
Let me comment out.

28
00:01:27,920 --> 00:01:30,870
And now let me bring it up, because this is a new concept.

29
00:01:30,890 --> 00:01:31,460
Okay.

30
00:01:31,550 --> 00:01:37,130
So how can we access properties of an object the same way?

31
00:01:37,160 --> 00:01:38,960
We have two ways.

32
00:01:39,080 --> 00:01:43,280
One is using the dot notation.

33
00:01:43,460 --> 00:01:46,940
Using the dot.

34
00:01:48,120 --> 00:01:49,140
Notation.

35
00:01:50,190 --> 00:01:50,950
Yes.

36
00:01:50,970 --> 00:01:51,960
So here we go.

37
00:01:52,980 --> 00:01:58,170
I would say, okay, get the name of the person.

38
00:01:59,740 --> 00:02:00,640
So here we go.

39
00:02:01,120 --> 00:02:06,910
So I take the person object which represents the who of my object here.

40
00:02:06,940 --> 00:02:15,520
Then I'll make use of dots and see that I have my property indicates that the the symbols here is different

41
00:02:15,520 --> 00:02:16,460
from this one.

42
00:02:16,500 --> 00:02:20,290
You see that this tells you that there's a property on my object.

43
00:02:20,290 --> 00:02:23,920
And if you read here, it says, what is property?

44
00:02:23,950 --> 00:02:26,630
And then the variable name is what is married.

45
00:02:26,650 --> 00:02:29,500
The first one and the value is a boolean.

46
00:02:29,830 --> 00:02:37,340
Okay, we see if I move my mouse on the edge, you can see that I have a property and it's a number.

47
00:02:37,420 --> 00:02:38,740
If you see my cursor here.

48
00:02:38,770 --> 00:02:39,580
Yes.

49
00:02:40,150 --> 00:02:40,600
You see that?

50
00:02:40,600 --> 00:02:45,880
If I open it, I have the more details about that, then that is how it is.

51
00:02:45,880 --> 00:02:46,450
So let me see.

52
00:02:46,450 --> 00:02:55,180
I won't have the person's name, so I'll type name and now I get a name so I can assign the variable.

53
00:02:55,210 --> 00:02:57,430
The result a variable called person.

54
00:02:58,570 --> 00:03:00,040
Let me say a person name.

55
00:03:00,070 --> 00:03:01,810
P name is equal to that.

56
00:03:02,380 --> 00:03:10,030
So if I insert that log the person name which is P name, person, name.

57
00:03:10,150 --> 00:03:11,530
You see, I have John.

58
00:03:11,650 --> 00:03:12,520
Perfect.

59
00:03:12,520 --> 00:03:17,740
So how can we access person h using the dot notation?

60
00:03:18,100 --> 00:03:21,580
So the same way make use of the H.

61
00:03:21,580 --> 00:03:23,740
So let me say bring this one here.

62
00:03:24,220 --> 00:03:25,270
Down here.

63
00:03:25,300 --> 00:03:35,640
Let's say get there, get the name h of the person this h of the person so person p name p h.

64
00:03:36,130 --> 00:03:37,390
Well the name must be disclosed.

65
00:03:37,400 --> 00:03:39,120
The person name to be more precise.

66
00:03:39,130 --> 00:03:40,630
Otherwise is not descriptive.

67
00:03:40,630 --> 00:03:41,710
P name is what?

68
00:03:41,890 --> 00:03:42,790
Sorry guys.

69
00:03:42,790 --> 00:03:46,000
My naming is not good person.

70
00:03:46,000 --> 00:03:46,300
Name.

71
00:03:46,300 --> 00:03:46,840
Yeah.

72
00:03:47,140 --> 00:03:48,880
And then person.

73
00:03:49,830 --> 00:03:51,810
H like that.

74
00:03:51,840 --> 00:03:52,410
Good.

75
00:03:52,560 --> 00:04:02,220
So now if I check for person H here inside mine, I have the person h if I check for a person.

76
00:04:03,050 --> 00:04:04,700
Person.

77
00:04:04,910 --> 00:04:08,130
H h is what?

78
00:04:08,160 --> 00:04:08,410
Yeah.

79
00:04:08,420 --> 00:04:08,660
Sorry.

80
00:04:08,690 --> 00:04:10,520
H is h sorry.

81
00:04:11,210 --> 00:04:11,930
Sorry guys.

82
00:04:11,930 --> 00:04:14,840
So person H I have 30.

83
00:04:15,050 --> 00:04:17,120
Then let's also check.

84
00:04:17,180 --> 00:04:20,779
Get the person.

85
00:04:21,899 --> 00:04:24,090
Mary Stiles, let me say stutters.

86
00:04:26,040 --> 00:04:26,360
But.

87
00:04:30,060 --> 00:04:31,260
Starters like that.

88
00:04:31,260 --> 00:04:35,220
So I can also check for the person status here.

89
00:04:36,030 --> 00:04:37,320
Person status?

90
00:04:38,760 --> 00:04:39,240
Hey.

91
00:04:39,240 --> 00:04:39,720
I was.

92
00:04:40,230 --> 00:04:41,390
So it's married?

93
00:04:41,400 --> 00:04:41,940
Yeah.

94
00:04:42,480 --> 00:04:43,770
So if I check for.

95
00:04:44,700 --> 00:04:45,470
What am I doing?

96
00:04:45,480 --> 00:04:46,800
So here is a different thing.

97
00:04:46,800 --> 00:04:48,060
So let me copy this one.

98
00:04:49,500 --> 00:04:52,630
And here you're going to be the person age.

99
00:04:54,120 --> 00:04:54,680
No.

100
00:04:54,690 --> 00:04:55,650
What am I doing?

101
00:04:56,100 --> 00:04:56,790
Sorry, guys.

102
00:04:56,790 --> 00:04:58,860
So let's say it is a person status.

103
00:04:59,280 --> 00:04:59,940
Get.

104
00:05:00,880 --> 00:05:02,950
Get the person.

105
00:05:06,840 --> 00:05:07,940
For starters.

106
00:05:09,300 --> 00:05:10,620
Get the person of the.

107
00:05:11,700 --> 00:05:13,170
Get a person.

108
00:05:14,020 --> 00:05:14,980
Married.

109
00:05:18,340 --> 00:05:18,840
Starters.

110
00:05:18,910 --> 00:05:19,450
Okay.

111
00:05:19,660 --> 00:05:20,950
Sorry for that, guys.

112
00:05:21,070 --> 00:05:24,310
So we see that if I stay, for starters, I'm going to get three or four.

113
00:05:24,340 --> 00:05:26,020
So, again, person starters.

114
00:05:26,050 --> 00:05:28,540
Now it is true because here is true.

115
00:05:28,750 --> 00:05:32,320
So what about if I want to get the person?

116
00:05:32,350 --> 00:05:35,020
Hubby, get the.

117
00:05:36,130 --> 00:05:38,170
Person hobby.

118
00:05:40,320 --> 00:05:43,920
Tavis So here you're going to be person.

119
00:05:45,830 --> 00:05:46,580
Hobbies.

120
00:05:46,730 --> 00:05:47,810
Now it's here.

121
00:05:47,810 --> 00:05:48,620
As what?

122
00:05:48,920 --> 00:05:49,760
Hobbies?

123
00:05:50,760 --> 00:05:52,230
Is that so?

124
00:05:52,800 --> 00:05:57,000
If I check for person hubby's here.

125
00:05:58,060 --> 00:05:58,630
I have it.

126
00:05:58,630 --> 00:06:01,510
That is the first method using the dot notation.

127
00:06:01,660 --> 00:06:07,330
So here we have some beautiful comments here to tell you that it's a sub topic.

128
00:06:08,260 --> 00:06:10,570
The next one is copy this.

129
00:06:10,570 --> 00:06:21,860
One is using the bracket notation, using the bracket notation and it's here you go.

130
00:06:21,880 --> 00:06:26,230
So here, let's say let me bring up this one here again.

131
00:06:26,440 --> 00:06:27,910
Bring this one.

132
00:06:29,000 --> 00:06:32,100
Let me show you first before I mess up with the code here.

133
00:06:32,120 --> 00:06:41,030
So I would take my person object and then scrape brackets and here code and see that I have the property

134
00:06:41,030 --> 00:06:42,170
name as before.

135
00:06:42,200 --> 00:06:43,430
I can say h.

136
00:06:43,700 --> 00:06:47,750
Now I can assign this one to a variable called person H.

137
00:06:47,750 --> 00:06:50,390
So it comes as person.

138
00:06:51,480 --> 00:06:55,080
Each is equal because I have the variable here.

139
00:06:55,110 --> 00:06:56,820
Let me comment this one out.

140
00:06:56,850 --> 00:07:00,150
And now if I check for person h.

141
00:07:00,980 --> 00:07:01,940
Person h.

142
00:07:01,970 --> 00:07:03,740
You see, I still have theory.

143
00:07:03,920 --> 00:07:06,230
It's also a way of what?

144
00:07:06,230 --> 00:07:08,420
Accessing the properties of an object.

145
00:07:08,510 --> 00:07:09,830
So the same thing.

146
00:07:09,830 --> 00:07:12,950
We can go ahead and also get a person happy.

147
00:07:13,280 --> 00:07:15,530
So here is the person hobby.

148
00:07:15,560 --> 00:07:17,230
Let me comment this one out.

149
00:07:17,240 --> 00:07:21,230
And here I'm going to use the square bracket.

150
00:07:21,440 --> 00:07:24,150
Like this single code or double code.

151
00:07:24,170 --> 00:07:26,150
Any of this one will to be fine.

152
00:07:26,480 --> 00:07:31,250
So if I check for person hobby, I still have it.

153
00:07:31,560 --> 00:07:34,280
What is it about the bracket notation?

154
00:07:35,120 --> 00:07:36,380
The next video.

155
00:07:37,070 --> 00:07:41,190
Let's see how we can update object properties.

156
00:07:41,210 --> 00:07:42,380
Let's say that.

157
00:07:43,730 --> 00:07:46,910
This is a record you have about a user.

158
00:07:47,480 --> 00:07:52,400
And then after two months or one year, the user sees the place.

159
00:07:52,610 --> 00:07:56,090
I have changed my name, so go ahead and update my name.

160
00:07:56,780 --> 00:08:03,160
And this mostly used in application, for example, updating a user record this where all of this logic

161
00:08:03,170 --> 00:08:04,190
comes into play.

162
00:08:04,820 --> 00:08:11,420
So objects made this one happen to be able to quote update a record in our database.

163
00:08:11,900 --> 00:08:18,320
If you're familiar with MongoDB, you call it as fine by ID and update by.

164
00:08:18,320 --> 00:08:27,560
We can do it using JavaScript, using the updating logic or concept to be able to update a data in an

165
00:08:27,560 --> 00:08:28,250
object.

166
00:08:28,370 --> 00:08:33,409
So in this video, let me show you how we can update record in an object.

