1
00:00:00,880 --> 00:00:03,880
Let's see how we can update.

2
00:00:05,480 --> 00:00:13,370
Object properties so we can do the same thing using two ways or in two ways.

3
00:00:13,370 --> 00:00:23,360
So let me comment this once that is under the ACT Section Properties and object.

4
00:00:26,100 --> 00:00:28,560
That is accessing properties of an object.

5
00:00:28,560 --> 00:00:31,500
So let me copy this one first and then let me comment out.

6
00:00:31,500 --> 00:00:32,870
Now everything is gone.

7
00:00:32,880 --> 00:00:37,710
So calm down here and let's say I think the current is best month, okay?

8
00:00:37,980 --> 00:00:45,810
Let's say here is here is going to be as updating object properties.

9
00:00:47,150 --> 00:00:51,410
Updating Objet properties.

10
00:00:53,740 --> 00:00:54,460
Yes.

11
00:00:55,340 --> 00:00:55,530
Yeah.

12
00:00:55,640 --> 00:00:57,290
So let me paste my object here.

13
00:00:57,320 --> 00:00:57,930
Good.

14
00:00:57,950 --> 00:01:00,940
We can achieve this logic in two ways.

15
00:01:00,950 --> 00:01:03,830
One is using the dot notation.

16
00:01:04,040 --> 00:01:06,890
So here I will say update.

17
00:01:09,380 --> 00:01:10,310
Update.

18
00:01:12,790 --> 00:01:13,750
The person.

19
00:01:16,170 --> 00:01:16,890
Name.

20
00:01:17,500 --> 00:01:18,080
Okay.

21
00:01:18,300 --> 00:01:22,710
So using the dot notation, let me say here, using the.

22
00:01:25,370 --> 00:01:28,880
The dot notation.

23
00:01:29,210 --> 00:01:29,660
Good.

24
00:01:29,990 --> 00:01:31,100
So here we go.

25
00:01:31,670 --> 00:01:38,450
You take the person and then Dot's name, and then E go to the name.

26
00:01:38,450 --> 00:01:39,360
You want to change?

27
00:01:39,380 --> 00:01:42,620
Let's say change this one to Billy.

28
00:01:44,160 --> 00:01:44,910
That is it.

29
00:01:44,940 --> 00:01:45,860
I've changed.

30
00:01:45,900 --> 00:01:46,530
I'm done.

31
00:01:46,530 --> 00:01:49,920
So if I check for my objects.

32
00:01:50,690 --> 00:01:53,660
My person object inside my console here.

33
00:01:54,020 --> 00:02:01,300
Now let's see that the name is no more John, but instead is Billy because originally it is joined here.

34
00:02:01,310 --> 00:02:05,210
But after updating, I'll change this one to Billy.

35
00:02:05,600 --> 00:02:07,880
I can also change the present age.

36
00:02:08,660 --> 00:02:11,870
So person don't age.

37
00:02:12,890 --> 00:02:15,680
At this point you are 100 years.

38
00:02:16,520 --> 00:02:23,060
So if I check for person, you see that I have what, 100 years instead of 30 years?

39
00:02:23,330 --> 00:02:28,610
So I can also change the person dot hobbies.

40
00:02:29,210 --> 00:02:33,260
Now instead of cooking, I would say you like hiking.

41
00:02:35,980 --> 00:02:39,790
Let's say you like also ski.

42
00:02:40,120 --> 00:02:40,470
Let's see.

43
00:02:40,840 --> 00:02:41,170
Let's see.

44
00:02:41,170 --> 00:02:44,260
Also, like dancing.

45
00:02:45,670 --> 00:02:46,450
Yes.

46
00:02:47,710 --> 00:02:48,680
Now let's see.

47
00:02:48,700 --> 00:02:50,070
Let me check for person.

48
00:02:50,080 --> 00:02:52,620
Now, look at the array we have.

49
00:02:52,630 --> 00:02:53,200
What?

50
00:02:54,130 --> 00:02:55,050
RB or hobbies.

51
00:02:55,060 --> 00:02:56,710
We have hiking and dancing.

52
00:02:56,710 --> 00:02:58,660
Not dancing, but dancing.

53
00:02:58,820 --> 00:02:59,590
Changes one to.

54
00:02:59,620 --> 00:03:00,040
Dancing.

55
00:03:01,030 --> 00:03:01,770
Yes.

56
00:03:01,780 --> 00:03:02,860
Check it out again.

57
00:03:02,890 --> 00:03:07,020
Now I have what I have dancing inside my RV.

58
00:03:07,030 --> 00:03:08,460
How we start.

59
00:03:08,470 --> 00:03:10,420
We have the index zero.

60
00:03:10,420 --> 00:03:14,200
Represent the hiking and add index one is dancing remember.

61
00:03:14,500 --> 00:03:16,510
And the array section of this course.

62
00:03:17,140 --> 00:03:17,680
Perfect.

63
00:03:17,680 --> 00:03:21,550
So now that is it about the updating using the.

64
00:03:23,430 --> 00:03:24,330
Dot notation.

65
00:03:24,330 --> 00:03:26,430
So why is this possible?

66
00:03:26,490 --> 00:03:36,180
Well, it's because the way object is objects are always passed by reference, meaning that whatever

67
00:03:36,180 --> 00:03:42,630
you make changes to the object, it affects the original one because you are referencing to that.

68
00:03:42,810 --> 00:03:43,390
Right.

69
00:03:43,410 --> 00:03:48,540
So behind the scene, we've made a copy of this original array.

70
00:03:48,540 --> 00:03:50,810
And then let me show you something here.

71
00:03:50,820 --> 00:03:53,780
We made a copy of this original array.

72
00:03:53,790 --> 00:03:55,170
Let's see, this is my copy here.

73
00:03:55,170 --> 00:03:57,120
Now, this is my copy here.

74
00:03:57,180 --> 00:04:01,860
And now I want to override the name to, let's say, Billy.

75
00:04:02,740 --> 00:04:10,060
Because I referenced I was going to update the original data that is advance topic about how object

76
00:04:10,060 --> 00:04:12,520
behaved object are passed by reference.

77
00:04:12,520 --> 00:04:17,320
So I'll explain to you some function very soon, but not very soon, let's say in the upcoming section

78
00:04:17,320 --> 00:04:18,250
of this course.

79
00:04:19,089 --> 00:04:21,850
Okay, that is the using the dot notation for you.

80
00:04:21,850 --> 00:04:24,550
What about using the bracket notation.

81
00:04:24,550 --> 00:04:32,200
So here also using the bracket bracket notation.

82
00:04:32,200 --> 00:04:40,150
So let me comment this one out or so the same way you make use of person and then square brackets,

83
00:04:40,180 --> 00:04:42,550
single or double codes each.

84
00:04:42,550 --> 00:04:45,010
Now this one, you are 90 years.

85
00:04:45,010 --> 00:04:45,880
Save it.

86
00:04:45,880 --> 00:04:47,140
Let's check the person.

87
00:04:48,840 --> 00:04:49,560
No.

88
00:04:50,520 --> 00:04:53,310
I have the 90 years also.

89
00:04:54,570 --> 00:05:03,360
So let's say that I did the person hobby square bracket code and let's see hobbies let's say this time

90
00:05:03,360 --> 00:05:07,650
around you don't like cooking, neither dancing.

91
00:05:08,190 --> 00:05:09,420
Let's say this time around.

92
00:05:09,420 --> 00:05:12,840
Let's say you would like coding this by a hobby.

93
00:05:13,680 --> 00:05:16,770
Let's say the person also like outing.

94
00:05:17,970 --> 00:05:18,660
Like going out.

95
00:05:18,660 --> 00:05:19,180
Right.

96
00:05:19,200 --> 00:05:26,520
So if I check the console for that, see that now the.

97
00:05:26,790 --> 00:05:27,270
Oh.

98
00:05:27,990 --> 00:05:29,040
Where I still have.

99
00:05:29,040 --> 00:05:29,700
Oh yeah.

100
00:05:29,700 --> 00:05:38,040
You see I taught is cooking coding out in and then age is 90 years and then they see that the properties

101
00:05:38,040 --> 00:05:46,560
are updated are the one that has been changed because here we are updating what the age and then the

102
00:05:46,560 --> 00:05:47,070
hobbies.

103
00:05:47,070 --> 00:05:52,410
So the name and this merit would be the same we know would not be changed.

104
00:05:52,500 --> 00:05:54,360
That's why we have it as that.

105
00:05:54,750 --> 00:05:56,550
Okay, guys, so that is it about that.

106
00:05:56,580 --> 00:05:58,830
What about let's say that.

107
00:05:58,830 --> 00:05:59,490
Well.

108
00:06:01,140 --> 00:06:05,060
After some time, a user comes into the place.

109
00:06:05,070 --> 00:06:07,500
I don't need my name anymore.

110
00:06:07,530 --> 00:06:17,040
Or based on the based on the business logic of your application can see that well after we decided to

111
00:06:17,040 --> 00:06:19,980
keep track of person's age.

112
00:06:20,070 --> 00:06:22,080
I think age is too personal.

113
00:06:22,080 --> 00:06:22,330
Right?

114
00:06:22,380 --> 00:06:26,430
So let me delete the age after I finish creating my object.

115
00:06:26,520 --> 00:06:28,050
How is it possible?

116
00:06:28,530 --> 00:06:29,220
How is it?

117
00:06:29,230 --> 00:06:29,970
Pass me thinking.

118
00:06:29,970 --> 00:06:35,130
Well, I can come in and remove it from here, but do it programmatically.

119
00:06:35,130 --> 00:06:38,900
So let's see how we can delete properties of an object.

120
00:06:38,990 --> 00:06:40,080
The next video.

