Hello and welcome.
In this fit you are introducing you to the javascript comparison operators javascript comparison operators
are used to compare values and will return.
The end result burning embers claiming is true or false.
So we use jammer scroop comparison operators tool always return the true value or force value.
So this is a basic table illustrating some comparison operators so our start from the top with the first
is known as the equal OPERATOR And is represented with the double equal symbol.
So what that does is checks.
If values are equal How case if you want to compare two values A You use the equal to operator.
If you want to check if values are equal both in value and data type.
Is this strictly equal to what is represented with the triple equal sign is single equal is used to
assign value.
So we must be careful between the distinction between single equals or double few on a check if something
is equal to something.
Here is a double sequence.
If you want to assign in value like you do in variables he use just a single equal to 1 pay.
The values are strictly equal in but data type and value who use to triple equal symbol.
If you want to check if values are not equal you use the exclamation mark in the course to sign that
check.
If the value is not equal if you want to check if the values are strictly not equal in value and data
you use the exclamation and double or symbol.
So if you want to check if a value is greater than another value you use the greater than sign.
For example you want to check if 5 is greater than 2.
If you want to check if it values lets let's use the less than symbol with checks n number less than
another number of value.
You can also use the greater than or equal to which is represented by the greater than sign.
If I was to cite what that does it.
Checks.
If the values is greater than or equal to the less than or equal to 3 percent by the less than symbol
and the cost to sign this checks.
If the value is less than or equal to.
So I'm going to jump into the console now and give you some basic examples of these comparison operators.
So we are using comparison operators.
There will always return.
That is true of force result.
So for example if I want to check if 4 is equal as to 5 that will return force equals four is not equal
to fact.
If I want to check if a value is strictly was in type and also in value so what I do first I create
a variable qualifiable cortex.
Give this a value of 7 quit a variable called Y.
Now give this value of 7 but the 7 will be a string value.
So we move the data type is different from variable X..
So now I can do a comparison.
I can see X is a course to why this will return to true because both of them have value of 7.
Now if I choose to triple course to it return full force because the data type is different then fairly
is the same.
So if I do X Troop or cause to Y that will give me results of force because they are not equal in data
type variable y has a data type of string.
You can tell because of the quotes that is enclose around the value and variable x is numerical which
has a value of 7.
They're the same in value but not the same.
In that attack.
So if you want to check two values are the same.
For example if I see it is not equal to 7 that will return true because it is bigger than 7 so it is
not equal to 7.
So if I want to check if the number is greater than another number one take.
If the 9 is greater than c hate that will evaluate to be true because 9 is greater than 8.
If we say 8 we call 8 is less than.
Say seven.
We have Valerie to be true because eight is greater than seven.
So here I am using the leston Sign compering if it is less than seven that has written force because
it is greater than seven.
If I was to see seven is less than eight that will evaluate to be true because seven is less template.
So let me quote a couple of variables.
A great variable we give you the value of 17.
Can I use the comparison.
So if I see a he is greater than or equal to 17 that will evaluate to be true because a variable A is
term seeing is greater than or equal to 17.
So that if that is to be true in fact create another variable see a quick variable B and I'm saying
it in value of 10.
And I want to check comparison so if I see is variable be less than or equal to 9 that evaluate to be
false because B is 10.
So these are basic examples of comparison operators.
Once you understand the basic concepts then it would be easy for you to use the compression operator.
That's it for this video.
Thank you for watching.
By phone.