var b = 2;
var cinditoin1 = a > b;
if (conditoin1){
}
if(condition1){
document.writeln("line 10: a > b: " + conditoin1 + "<br/>");
}
else{
document.writeln("line 13: a > b: " + conditoin1 + "<br/>");
}
var condition2 = a < b;
if(condition1){
document.writeln("line 18: a > b: " + conditoin1 + "<br/>");
}
else if(condotion2){
document.writeln("line 21: a > b: " + conditoin2 + "<br/>");
}
else{
document.writeln("line 24: a is not more than b and not less than b" + "<br/>");
}
a = b;
condition1 = a > b;
condition2 = a < b;
if(condition1){
if(condition2){
document.writeln("line 33: Wow,there is something " + "<br/>");
}
else{
document.writeln("line 36: a > b: " + condition1 +"<br/>");
}
}
else{
if(condition2){
document.writeln("line 37: a < b: " + condition2 + "<br/>");
}
else{
document.writeln("line 44: a is not more than b and not less than b" + + "<br/>");
}
}
switch (1) {
case 1:
{
document.write(1 + "<br/>");
}
case 2:
{
document.write(2 + "<br/>");
}
break
case 3:
{
document.write(3 + "<br/>");
}
break;
default:
{
document.write("(default <br/>");
}
}
function isInteger(num){
var result = false;
//判断num是否为整数
result = (parseInt(num) == parseFloat(num));
if(result){
document.write(num + "is an integer" + "<br/>");
}
else{
document.write(num + "is not an integer" + "<br/>");
}
return result;
}
//若15为整数,输出15是整数
isInteger(15);
//若15,15不是整数,输出15,15不是整数
isInteger(15,15);
function printDaffodilNumber(){
document.write("Print out all daffodil number: " + "<br/>");
for(var num = ; num < ; num){
var unitsDigit = num % 10;
var tensDigit = parseInt((num / 10) % 10);
var hundredsDigit = parseInt(num / 100);
//判断是否为水仙花数;并输出
}
}
console