Afrikaans
Akan
Albanian
Amharic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Now these symbols, such as the greater or the lesser than or the three equals signs, are known in programming
as comparatives because they allow us to compare two different values.
So we've seen and used the three equals signs.
And this is checking whether if the left hand side is equal to the right hand side.
Now you can also use a exclamation mark and two equal signs to check whether if the left hand side is
not equal to the right hand side, as well as whether if something is greater then something else or something
is lesser than something else or greater than equal or lesser than equal.
And these comparatives give our conditionals, like if and else statements, a lot more flexibility.
Now some of you might have seen another type of equality comparative.
So instead of using a three equal sign sometimes you see people using two equal signs.
Now there's a big difference however between the two of these.
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
the string 1.
So this is 1 as a piece of text essentially, and they have different data types,
because if we say type of a we get number and type of b we get string.
So at this point if we check to see if a triple equals b, then if it's true we will get console.log
“yes”
and if it's false then we will get console.log “no”.
So if I go ahead and hit enter right now then you can see that we get no, a does not triple equal b.
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
you can see we get
yes
in this case.
So the important difference between three equal signs and two equal signs is that, even though they both
check for equality, with three equal signs
it’s also checking to see that the data types are matching, whereas with two equal signs it doesn't care
about the data types.
So let's head back to our love calculator and maybe one more thing that we could ask of it.
What if we could separate our love score ranges a little bit more finely?
So, for example, if we could have a different message for people who got between 1 and 30, then people
who got between 30 and 70, and those who were ultra lucky and got between 70 and 100.
How would we be able to do that?
Well, we would have to learn how to combine different comparatives, and we'll tackle that in the next
lesson.
So that's all for me for today.
And I will see you on the next lesson.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.