Comparison Operators

2 minutes
Share the link to this page
Copied
  Completed
The equality operator converts the operands if they are not of the same type, then applies strict comparison. If both operands are objects, then JavaScript compares internal references which are equal when operands refer to the same object in memory.

Transcript

Hello, in this video we are going to look at comparison operators. So, as the name suggests, allows us to compare two values and see if these four conditions are met. So, for example, you can check if two runs are equal to each other. If they are, then it will return true. If they're not, they'll return false. So again, we're going to use the wonderful world of rent.

And inside of here, what we are going to do is a couple of numbers so 35 equal five that's just the simple comparison operator of checking something the teacher will no longer check if it's not equal to each other for is not equal to five. And then lucky another similar operator the comparison operator very similar to this which is like so prefer this one because you know, the exclamation mark UD into play not in computer, Quint. Now in here we are we can check if the condition I mean the value on the left is bigger than the value of the right but if for the way to the same and is number one. So if we put equal at the end what this does, it says is the left value greater than or equal to the right value. So, these two you'll see the result therefore, the comparison operator let's give it around and see what yeah those few more seconds this will pump out the apple as you mean nothing Run says this is true, true false, true.

True. So I guess I'm just five equal five. Yes, it's true. That is true false, does 595 it does so that is five greater than five. No, it isn't is equal to it. And then if five less than five, No, it isn't, is equal to A is for greater than or equal to, or greater than where it is equal to is met the condition.

And same with that one as well. So that's a for comparison operators. This is one of the key features not not just our python programming, but you know, coding in general, and you'll be using these operators in some capacity. immensely. Trust me, you will be using comparison operators all of the time in stuff like conditional statements and loops, which we'll be covering later on. So that's it for comparison operators.

Thanks for watching, and I'll see you in the next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.