<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Statement</title> <Script> varI= 9;//Modifying the I value if(i> Ten) {document.write ("I'm more than ten"+"</br>"); } Else if(i< Ten) {document.write ("I'm less than ten"+"</br>"); } Else{document.write ("I'm equal to 10 ."+"</br>") } </Script> <Script> varI= 5;//Modifying the I value Switch(i) { Case 1: document.write ("I=1") Break; Case 2: document.write ("i=2") Break; default: document.write ("i=" +I+"</br>"); Break; }//Jump statement break (jump out of loop--end loop) Continue (skips the loop) return (return a value, end) </Script> <Script> for(varI=0; I<Ten; I++){ if(i==5){ Break;//continue;} document.write ("i="+I+"</br>"); } </Script> <Script> varI= [1,2,3,4,5,6]; varJ; for(Jinchi) {//If J is an element of Idocument.write (I[j]+"</br>"); } </Script> <Script> varI= 1; while(i<Ten) {document.write ("i="+I+"</br>"); I++; } document.write ("</br></br></br></br>")</Script> <Script> varI= Ten; Do{//will execute the statement in the do once to judgedocument.write (i+"</br>"); } while(i<2) {document.write ("i="+I+"</br>"); I++; } </Script></Head><Body></Body></HTML>
JavaScript Learning Note JS Conditional Statement Section III (original) Reference JS usage table (2017-09-14-15:55)