1 00:00:00,420 --> 00:00:06,930 In this part we are going to talk about primitive and rare fitness a wearable can hold one of the two 2 00:00:06,930 --> 00:00:12,310 radical types which is primitive rarely used or reference or rather you primitive. 3 00:00:12,320 --> 00:00:18,840 Well do we still value stored with outside by where it is and the reference is the value store that 4 00:00:18,840 --> 00:00:20,550 we have aside by reference. 5 00:00:21,030 --> 00:00:22,450 But what is the difference. 6 00:00:22,490 --> 00:00:25,260 Let's take an example for example. 7 00:00:25,260 --> 00:00:36,420 Now we are going to clear a variable name which is equal to Sam and then we create another copy which 8 00:00:36,420 --> 00:00:38,980 is equal to a name. 9 00:00:39,000 --> 00:00:51,730 So now we are going to clean out the result. 10 00:00:51,740 --> 00:00:56,330 This is not surprising because name copy is equal to a name. 11 00:00:56,480 --> 00:01:02,280 But now we are going to change the name to another for example. 12 00:01:02,420 --> 00:01:04,400 Now is equal to Mary 13 00:01:12,340 --> 00:01:14,100 after the change of the name. 14 00:01:14,320 --> 00:01:22,470 We see the result is like this name is equal to Mary but on them copy is still the same. 15 00:01:22,570 --> 00:01:24,280 This has to be called name copy. 16 00:01:24,280 --> 00:01:28,310 We will not be affected because of the change of the name. 17 00:01:28,330 --> 00:01:33,740 Let's take a lot of time reference type. 18 00:01:33,790 --> 00:01:35,200 Now we create a user 19 00:01:38,030 --> 00:01:42,210 which only have the name properties which is Mike. 20 00:01:42,890 --> 00:01:45,620 And then we create another copy. 21 00:01:45,620 --> 00:01:49,910 Does that copy is equal to user. 22 00:01:49,940 --> 00:01:52,550 Now again we are going to appear now. 23 00:01:53,140 --> 00:01:53,720 We s 24 00:02:08,700 --> 00:02:16,170 again you can see that you saw is as expected because you use a copy is equal to a user. 25 00:02:16,710 --> 00:02:25,800 But now when we try to adjust the name of might become Mary for example. 26 00:02:25,790 --> 00:02:31,050 Do as I thought name is equal to Mary 27 00:02:36,660 --> 00:02:42,200 now you can see auto use a copy do not change it just echo to use it. 28 00:02:42,260 --> 00:02:51,840 It also will be changed that because of the user name is changed to Mary. 29 00:02:51,840 --> 00:02:57,360 So what can we do if we really want to create a copy of user. 30 00:02:57,540 --> 00:03:04,700 We can use the spread operator for some poll in the state of equal to a user. 31 00:03:04,830 --> 00:03:09,530 We can change to portable user. 32 00:03:10,380 --> 00:03:12,180 And now you can see immediately. 33 00:03:12,630 --> 00:03:19,470 Although the name of the user is changed and the name of the user a copy will not be changed. 34 00:03:20,700 --> 00:03:28,530 So this is the defense of permitted type and a reference type and how you beauty make a copy from an 35 00:03:28,560 --> 00:03:28,890 object.