Lesson 6 of 23
&&, ||, ! மற்றும் switch&&, ||, ! and switch
9 min 25 XP
&& (AND) இரண்டும் true ஆனால் true; || (OR) ஏதேனும் ஒன்று true ஆனால் true; ! (NOT) மாற்றும். ternary operator: condition ? a : b.
&& (AND) is true when both sides are true, || (OR) when either is, and ! (NOT) flips a condition. The ternary operator condition ? a : b picks one of two values.
Example: edit me and press Run
Press Run to see the result here.switch ஒரு மதிப்பைப் பல case-களுடன் ஒப்பிடும். ஒவ்வொரு case முடிவிலும் break வேண்டும், இல்லையெனில் அடுத்த case-ம் இயங்கும் (fall-through).
switch compares one value against many cases. End each case with break, or execution falls through into the next case.
Example: edit me and press Run
Press Run to see the result here.