lesser than, greater than, equal to
The lesser than and greater than symbols are pretty easy to comprehend. They are the same as in the real world (<,>), but the 'equal to' symbol is pretty different, you would think it should be '=' but it's not, well not exactly, it's actually === (3 ='s), who knows why that is. I can understand if it's 2 ='s but 3? I don't know why that is, I might be missing something. Anyway, the only time you use those are in 'if' and 'else if' statements, as in: if(3>4){} or else if(3==3){} or else if(4<3){}.
lesser or equal to, and greater or equal to
This is more basic than it sounds actually. All you need to do is combine either a '>' or a '<' and after it a '=' (NEVER BEFORE) and that's about it, there is not much to it, I'll give you some examples: if(4>=2){} else if(4<=2){}
and, or, and not
This is quiet important to know if you don't like to type much. By adding one of these it makes your life a WHOLE lot easier when making 'if' and 'else if' statements. Let's see an example of 'and': if(3<4&&9>8){}
The only thing you add is '&&' (2 &'s). Now for the 'or': if(3<4||9>8){}. For this you just have to add '||' (2 ||'s). And now for the not: if(3!=4){} you add ! and = (!=). That's about it
Experiment with those symbols and try different things out to understand it a bit more! (:
-Rick "Rixel" (TekBird)
No comments:
Post a Comment