1
00:00:01,530 --> 00:00:05,040
Let me show you how I'm going to solve this particular challenge.

2
00:00:05,070 --> 00:00:10,690
So the first one and the second point we have done before, so let me move fast here.

3
00:00:10,710 --> 00:00:12,520
So I will say solution.

4
00:00:13,560 --> 00:00:15,340
Solution.

5
00:00:16,650 --> 00:00:17,070
Yes.

6
00:00:17,070 --> 00:00:20,280
So let me create my user object quickly.

7
00:00:20,730 --> 00:00:22,740
So let me add more property names.

8
00:00:22,770 --> 00:00:29,370
The name the name here is John as before.

9
00:00:29,610 --> 00:00:40,230
And then the age is also 30 as before, and then the location is also as before.

10
00:00:43,910 --> 00:00:44,450
All right.

11
00:00:44,450 --> 00:00:50,450
So the difference here is that you should add a property called Married with a Boolean.

12
00:00:50,450 --> 00:00:55,220
So here is married or married, let's say, is this married or is married?

13
00:00:55,220 --> 00:00:56,060
Here is married.

14
00:00:56,060 --> 00:01:02,660
So here we specify as is married, which is by default, which is false?

15
00:01:03,590 --> 00:01:04,430
Yes.

16
00:01:05,180 --> 00:01:05,810
Good.

17
00:01:05,810 --> 00:01:07,850
You claim it can be true or false because it is.

18
00:01:07,850 --> 00:01:12,380
Specify here that we should specify whether it is true or false.

19
00:01:12,440 --> 00:01:20,480
But here comes at a method call is married which print whether the person is married or not.

20
00:01:20,480 --> 00:01:24,500
So that is the clue or differences between this and the previous one.

21
00:01:24,620 --> 00:01:30,200
So for this time around, let me create a functions outside this to show you how we can add object in

22
00:01:30,200 --> 00:01:31,220
a different way.

23
00:01:31,220 --> 00:01:36,560
So here, add the object method to it.

24
00:01:36,560 --> 00:01:45,710
So I would take the user object as we did before, and then this one is going to be as is married where

25
00:01:45,710 --> 00:01:49,820
I think yeah, he says that the method must be married.

26
00:01:49,820 --> 00:01:52,070
So here we married.

27
00:01:52,070 --> 00:01:52,610
Sorry.

28
00:01:52,610 --> 00:01:55,550
And the function name supposed to be is married.

29
00:01:55,790 --> 00:01:57,380
The method code is married.

30
00:01:57,380 --> 00:01:57,680
Right.

31
00:01:57,680 --> 00:01:59,300
So sorry on my side.

32
00:01:59,300 --> 00:02:09,289
So it's married now is equal to function, my parentheses and my carry braces.

33
00:02:09,470 --> 00:02:16,970
So here, let's check if this does get married.

34
00:02:17,030 --> 00:02:18,710
Meaning if it is true.

35
00:02:18,710 --> 00:02:21,590
So this one is the same as equal to true.

36
00:02:22,370 --> 00:02:27,170
Because remember, we have true fee and force values, right?

37
00:02:27,170 --> 00:02:32,510
So if here we have false here, it means that it's a false value, right?

38
00:02:32,630 --> 00:02:35,330
And if it's empty, string is a false value.

39
00:02:35,540 --> 00:02:42,470
So right now if I do this one behind the scene is false because here is married is false.

40
00:02:42,740 --> 00:02:43,160
All right.

41
00:02:43,160 --> 00:02:46,610
So here it can be specified as is equal to false or whatever.

42
00:02:46,610 --> 00:02:49,130
So here this is shorthand syntax to go.

43
00:02:49,400 --> 00:02:53,330
So if that's the case, then what are we supposed to do?

44
00:02:53,720 --> 00:02:56,390
Then let this console look some text this.

45
00:02:56,390 --> 00:02:57,380
That's for the meantime.

46
00:02:57,380 --> 00:02:58,430
Let's make it very simple.

47
00:02:58,430 --> 00:03:10,310
One here and then back take and then my dollar sign basis and then I will say this dot name is.

48
00:03:11,300 --> 00:03:12,260
Married.

49
00:03:15,090 --> 00:03:15,710
Ayres.

50
00:03:15,720 --> 00:03:17,400
You can come down here.

51
00:03:17,550 --> 00:03:22,110
Errors, then copy the same thing here.

52
00:03:22,350 --> 00:03:28,340
This time around, our change here is not is not married.

53
00:03:28,350 --> 00:03:34,740
So before I save this one, or before you call the method, what would be the result you're going to

54
00:03:34,740 --> 00:03:35,490
be?

55
00:03:35,790 --> 00:03:38,250
Is married or is not married?

56
00:03:38,380 --> 00:03:41,730
Well, based on what we have, this one is false.

57
00:03:41,730 --> 00:03:43,530
So this one will run.

58
00:03:43,830 --> 00:03:44,100
Okay.

59
00:03:44,160 --> 00:03:46,560
So this one is called the is not married.

60
00:03:46,650 --> 00:03:47,850
So check it out.

61
00:03:47,850 --> 00:03:52,680
So let's say invoke, invoke the function.

62
00:03:53,790 --> 00:03:58,530
So I would take my user object and then dot.

63
00:03:59,530 --> 00:04:03,370
Is married like that as mine.

64
00:04:03,730 --> 00:04:05,630
And now check the console.

65
00:04:06,040 --> 00:04:11,350
You see that John is not married because he is false.

66
00:04:11,380 --> 00:04:16,959
If I change this one to true, if I save this one now see that this one will run.

67
00:04:16,959 --> 00:04:20,399
Because at this point, this that married is true.

68
00:04:20,410 --> 00:04:22,570
So now this one will run.

69
00:04:22,570 --> 00:04:25,210
And indeed, John is married.

