1
00:00:00,940 --> 00:00:09,550
Let's finish up with a conditional statement by talking about two, three and four C values, because

2
00:00:09,550 --> 00:00:16,379
I have kept mentioning about true fee and foresee values many times, but we haven't talked about.

3
00:00:16,420 --> 00:00:18,000
So this is the time.

4
00:00:18,010 --> 00:00:21,220
So what is true fee and what is false values?

5
00:00:21,220 --> 00:00:24,400
So with the picture even explain everything.

6
00:00:24,400 --> 00:00:26,020
So let's get going.

7
00:00:26,020 --> 00:00:28,060
Let me show you what it means.

8
00:00:28,780 --> 00:00:29,380
Okay.

9
00:00:30,280 --> 00:00:40,480
So in JavaScript, a true free value is a value that considered true when evaluated in a boolean context.

10
00:00:41,020 --> 00:00:46,510
All values are true values unless they are defined as forcing.

11
00:00:47,020 --> 00:00:49,780
So it simply means that.

12
00:00:49,780 --> 00:00:55,120
So let me have some space here and let me comment out this.

13
00:00:55,120 --> 00:01:00,880
Once you are done with that, I'll provide the source code for you if want to have a look.

14
00:01:01,150 --> 00:01:03,280
So here is.

15
00:01:04,280 --> 00:01:04,849
That.

16
00:01:04,849 --> 00:01:06,860
And let's talk about true fee.

17
00:01:09,580 --> 00:01:14,140
Trophy and forcing values.

18
00:01:14,980 --> 00:01:23,800
So trophy values simply means that when the logic is being evaluated in the context of a boolean, then.

19
00:01:24,720 --> 00:01:28,320
It's considered to be true because now you made mention of the E!

20
00:01:28,320 --> 00:01:31,650
Statement, so it's time to talk about the truth and false values.

21
00:01:32,040 --> 00:01:43,320
So an example of true field values and then example of the forsey values.

22
00:01:44,150 --> 00:01:48,350
So value, which considered to be false is called false values.

23
00:01:48,440 --> 00:01:50,570
And one is the.

24
00:01:51,440 --> 00:01:52,880
Force itself.

25
00:01:54,260 --> 00:01:57,320
And then next one is zero.

26
00:01:57,710 --> 00:01:59,900
Next one is empty string.

27
00:01:59,930 --> 00:02:05,390
Next one is narrow and next one is undefined.

28
00:02:06,470 --> 00:02:12,620
So apart from these ones, any other value is considered to be true.

29
00:02:13,280 --> 00:02:14,570
So a moment of truth.

30
00:02:15,620 --> 00:02:19,030
Now let's declare a variable here.

31
00:02:19,040 --> 00:02:21,080
Let's let

32
00:02:24,290 --> 00:02:28,550
each simple one is equal to empty string.

33
00:02:28,940 --> 00:02:38,060
So now if I evaluate this one in a boolean context, that means if statement or you can use ternary

34
00:02:38,060 --> 00:02:38,780
operator.

35
00:02:39,080 --> 00:02:40,760
Unless make your if statement.

36
00:02:40,850 --> 00:02:43,670
So if h.

37
00:02:44,700 --> 00:02:47,370
Meaning if h exists.

38
00:02:47,670 --> 00:02:50,700
Meaning this code is going to run.

39
00:02:51,590 --> 00:02:52,490
Let me see.

40
00:02:53,210 --> 00:02:54,050
Yes.

41
00:02:54,840 --> 00:02:58,860
It is true else.

42
00:02:59,580 --> 00:03:00,920
It is false value.

43
00:03:00,930 --> 00:03:01,920
Then.

44
00:03:02,190 --> 00:03:03,960
Console that log.

45
00:03:04,090 --> 00:03:06,030
Console that log.

46
00:03:06,390 --> 00:03:07,320
You will say.

47
00:03:08,610 --> 00:03:09,450
Sorry.

48
00:03:14,940 --> 00:03:15,930
It is false.

49
00:03:16,290 --> 00:03:22,840
So save it now and see that it is false because it is an empty string, which is the.

50
00:03:22,860 --> 00:03:24,390
So it is false.

51
00:03:24,420 --> 00:03:29,390
If I change this 1 to 0 zero is false value.

52
00:03:29,400 --> 00:03:29,790
Right?

53
00:03:29,790 --> 00:03:31,360
So it's going to be false.

54
00:03:31,360 --> 00:03:37,080
So this code run, if I save the code again still I still see.

55
00:03:37,080 --> 00:03:38,630
Sorry, it is false.

56
00:03:38,640 --> 00:03:48,360
If I change the edge to now if I save it refresh it is still false because Noor is considered to be

57
00:03:48,360 --> 00:03:49,080
forcing.

58
00:03:49,200 --> 00:03:57,330
If I change this one to undefined again, undefined here is false value.

59
00:03:57,330 --> 00:04:01,590
So it's going to be also asked false, which is this.

60
00:04:01,800 --> 00:04:08,130
But if I provide even zero here you are h zero again is false.

61
00:04:08,130 --> 00:04:09,930
So pay attention to this.

62
00:04:10,170 --> 00:04:11,370
It's really important.

63
00:04:11,430 --> 00:04:14,280
We are trying to make condition perfect.

64
00:04:14,280 --> 00:04:18,180
So any other value apart from this is considered to be true.

65
00:04:18,390 --> 00:04:21,180
So if I provide, let's say 20.

66
00:04:22,190 --> 00:04:22,880
If I save it.

67
00:04:22,880 --> 00:04:24,080
Yes, it is true.

68
00:04:24,650 --> 00:04:26,480
If I provide even a string.

69
00:04:28,500 --> 00:04:31,050
Yes, it is true that provide.

70
00:04:31,050 --> 00:04:32,490
Yes, whatever.

71
00:04:32,490 --> 00:04:33,660
Here is a string.

72
00:04:34,050 --> 00:04:35,460
Yes, it is true.

73
00:04:35,550 --> 00:04:39,630
So any other value apart from force values are considered to be true.

74
00:04:39,630 --> 00:04:44,310
So when making conditions pay attention to these values, it's really important.

75
00:04:44,670 --> 00:04:45,780
The next video.

76
00:04:45,870 --> 00:04:49,550
Let's get started with JavaScript loops.

77
00:04:49,560 --> 00:04:52,140
That is repetition of task.

