WEBVTT 0 00:00.390 --> 00:06.570 Now these symbols, such as the greater or the lesser than or the three equals signs, are known in programming 1 00:06.600 --> 00:10.890 as comparatives because they allow us to compare two different values. 2 00:10.980 --> 00:13.760 So we've seen and used the three equals signs. 3 00:13.950 --> 00:19.600 And this is checking whether if the left hand side is equal to the right hand side. 4 00:19.830 --> 00:26.370 Now you can also use a exclamation mark and two equal signs to check whether if the left hand side is 5 00:26.370 --> 00:32.340 not equal to the right hand side, as well as whether if something is greater then something else or something 6 00:32.340 --> 00:37.050 is lesser than something else or greater than equal or lesser than equal. 7 00:37.080 --> 00:43.560 And these comparatives give our conditionals, like if and else statements, a lot more flexibility. 8 00:43.590 --> 00:47.750 Now some of you might have seen another type of equality comparative. 9 00:47.880 --> 00:54.350 So instead of using a three equal sign sometimes you see people using two equal signs. 10 00:54.350 --> 00:57.230 Now there's a big difference however between the two of these. 11 00:57.240 --> 01:04.590 So let's say we have a variable a and it's equal to 1 and then we have a variable b that's equal to 12 01:04.860 --> 01:06.690 the string 1. 13 01:06.690 --> 01:12.140 So this is 1 as a piece of text essentially, and they have different data types, 14 01:12.210 --> 01:20.430 because if we say type of a we get number and type of b we get string. 15 01:20.580 --> 01:30.540 So at this point if we check to see if a triple equals b, then if it's true we will get console.log 16 01:30.570 --> 01:31.570 “yes” 17 01:31.780 --> 01:35.670 and if it's false then we will get console.log “no”. 18 01:35.670 --> 01:43.500 So if I go ahead and hit enter right now then you can see that we get no, a does not triple equal b. 19 01:43.890 --> 01:53.790 But, however, if I was to modify this and change it to if a is a double equal to b and I hit run, then 20 01:53.790 --> 01:54.430 you can see we get 21 01:54.450 --> 01:55.040 yes 22 01:55.050 --> 01:56.280 in this case. 23 01:56.340 --> 02:02.580 So the important difference between three equal signs and two equal signs is that, even though they both 24 02:02.580 --> 02:05.590 check for equality, with three equal signs 25 02:05.610 --> 02:11.400 it’s also checking to see that the data types are matching, whereas with two equal signs it doesn't care 26 02:11.400 --> 02:12.770 about the data types. 27 02:12.780 --> 02:18.880 So let's head back to our love calculator and maybe one more thing that we could ask of it. 28 02:19.050 --> 02:24.450 What if we could separate our love score ranges a little bit more finely? 29 02:24.540 --> 02:31.110 So, for example, if we could have a different message for people who got between 1 and 30, then people 30 02:31.110 --> 02:38.300 who got between 30 and 70, and those who were ultra lucky and got between 70 and 100. 31 02:38.310 --> 02:40.310 How would we be able to do that? 32 02:40.500 --> 02:46.770 Well, we would have to learn how to combine different comparatives, and we'll tackle that in the next 33 02:46.770 --> 02:47.270 lesson. 34 02:47.340 --> 02:48.870 So that's all for me for today. 35 02:48.930 --> 02:50.910 And I will see you on the next lesson.