JS-Loop and If
< Beginner JS >< Function >< Variable >< Loop-If >< OOP > if statement if(MemberAge<18){ document.write("teen"); } if..else if(MemberAge<18){ document.write("teen"); } else{ document.write("big"); } if...else if...else if(MemberAge<18){ document.write("teen"); } else if(MemberAge>18){ document.write("adult"); } else{ document.write("just 18"); } Switch statement Ex1: switch(memcat){ case1: Fee=100; case2: Fee=150; case3: Fee=300;} Ex2: with break switch(memcat){ case1: Fee=100; break; case2: ...; } Ex3: no matching than default case switch(memcat){ case1: Fee=100; break; case2: ...; default: Fee:400; } Counting and Looping Executing a portion of code over and over again until an intermediaite condition accurs For statement Used as counter Syntax: for(start;condition;expression)statement Ex: var Number; for(Number=0;Number<=10;Number++) document.write("Num"+Number+"