Equal to NOT equal to Less than & greater thanWe can understand it better by using some examples. To check the status we will be using document.write to print the result by saying “True” or “False” . We will be using one if condition for this. Comparison operator
You can see the above out put will be FalseThis way we can check different comparison conditions. Note that when we use == we are matching only value not type but when we use === we are comparing both type and value. Here is a short table to explain various conditions and its outputs for different if conditions. Note that we have changed the if condition checking only and in all the cases we have considered the value of my_var=5
Less Than < , Greater Than >We will continue with our variable like this my_var=5 , here is the table.
Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
| |||||||||||||||||||
More on Loops and Variables | |||||||||||||||||||