Hello and welcome.
In this video I'll be introducing you to the javascript logical operators for JavaScript logical operators
who are used to determine the logic between variables or values.
So this is a basic table that shows you two logical operators.
The first is called and and is represented by the ampersand symbol.
What that does.
It checks if all the conditions are met.
And it will return a boolean result either true or false.
If all the conditions are met it will return true.
If not it returns false.
The links is the or operator which is represented by the pipe symbol.
It checks if any condition has been met and it will return a true boolean result.
So the key distinction between the end and the all is that when you're using the.
And to check conditions or the conditions has to evaluate to true.
If they're not met then it will return a false boolean result boolean resolved basically means true
or false in the all operator you only have to satisfy one condition it will return true result.
So let me quickly illustrate how the logical operators are used in the console.
So I'm going to start by creating a couple of variables are quite variable x.
I give you the value of seven are great on another variable and I'm going to call this variable Y and
I'll give it a value of six.
Now I can use the logical operators to check the condition so I can say X is less than 10.
If x is less than 10 and Y is greater than 6.
This will evaluate to be false because the first condition is true X is less than 10 but second condition
is forced because Y is not greater than six so it will evaluate to be false.
So if I use the all operator with the same condition it will return true because one part of the condition
is true.
So it will return everything as true.
For example the same illustration if I come in and say X is less than 10
or Y is greater than six.
This will evaluate to be true because the first part of the condition is true X is less than 10.
So that's basically how you use a logical operator.
In a nutshell once you understand this basic use of it then it will be able to it'll make most sense
when you start using it later.
Thank you for watching and bye for now.