Hello, in this programming video, I am going to show you logical operators. So logical operator essentially allow you to, you know, check if you if you have two or three more values that are, you know, equate to true or false and you can combine if you want to know all of them to be true as part of them to be true or you know, maybe you don't want them to be true. And let me show you exactly what I mean. So if I create a local bar for the bar, one on the funny value of true, ball true. And now, we're going to console. First of all, the first operator is the end operator AND operator, console dot log.
And here we are going to pull var one double ampersand that is the operator for this double ampersand var two. And let's see what we get. If we run it, we get true. So what happens if we change one of them? Get false. And the reason for that is the end operator says that all of the inputs have to be true.
If one of them is false, then I, you know, then I'm angry then on false as well. Let me show you the next one is all operator, and this is true vertical pipes. And if I run it, he gets true, and you'd only recall one of the inputs on either side to equate to true. And if I change this to focus, however we hear you know, false Let me show you the left. The last operator is the NOT operator. This is simply an exclamation mark.
And if I do this not in front of some other input, it could be in front of the output of death or the death and you need to put that in brackets, or just a single variable on its own. That's what we get. Yeah, true. So basically just inverted it. That's all the NOT operator think it does. I think you know, where would we use it?
So this is great to be used in conjunction with the comparison operators. So let me just quickly show you something. So if I create another variable 192 equals 10, two ball, three equals 11. No four Let's do that. Okay, so we're going to do console dot log. And we want to check if, essentially, num one is less than 10.
And number three is the same as 11. So we want both conditions to be true. So first of all, for brackets and we want to check no one is less than two. We also want to check so this is where the dough ampersand comes in. If num query is. brackets number is equal to four and save it see what we get.
We get a print of true because nine is less than 10. So this essentially equates to true. Num three does equal num four, yes, 11 is equal to 11. So this also equates to True, true and true is not true. So that's it for logical operators. If you have any questions, feel free to pop me a message and I'll assist you.
There'll be the GitHub link as well. So feel free to peruse through that. And as usual, I look forward to seeing you in my next awesome video.