SOURCE

console 命令行工具 X clear

                    
>
console
var score = 80;
if (score > 60) {
    document.write("很棒~"+ "<br/>");
}

document.write('---------------------------------------------<br/>')

var score = 40;
if (score < 60) {
document.write("需要补考噢~"+ "<br/>");
} 
else {
document.write("很棒~"+ "<br/>");
}

document.write('---------------------------------------------<br/>')

var time = 8;
if (time < 12){
document.write("早上好!"+ "<br/>");
}
else if (time >=12 && time < 18){
document.write("下午好!"+ "<br/>");
}
else{
document.write("晚上好!"+ "<br/>");
}

document.write('---------------------------------------------<br/>')
var gender = "女";
var height = 172;
if(gender=="男"){
if(height>180){
document.write("高个子男生"+ "<br/>");
}
else{
document.write("矮个子男生"+ "<br/>");
}
}
else{
if (height > 170){
document.write("高个子女生"+ "<br/>");
}
else{
document.write("矮个子女生"+ "<br/>");
}
}
document.write('---------------------------------------------<br/>')
function isInteger(num){
    var result=false;
    if (parseInt(num) == parseFloat(num)){
        result= true;
    }
    return result;
}
var num=15;
if(isInteger(num)){
    document.write(num+"是整数"+ "<br/>");
}
else{
    document.write(num+"不是整数"+ "<br/>");
}
var num=15.15;
if(isInteger(num)){
    document.write(num+"是整数"+ "<br/>");
}
else{
    document.write(num+"不是整数"+ "<br/>");
}

document.write('---------------------------------------------<br/>')
function printDaffiodilNum(){
    document.write("Print daffiodil number:"+"<br/>");
    for(var num=100;num<1000;num++){
        var unitsDigit =num%10;
        var tensDigit=parseInt((num/10)%10);
        var hundredsDigit=parseInt(num/100);
        if (num == (unitsDigit * unitsDigit * unitsDigit + tensDigit * tensDigit * tensDigit + hundredsDigit * hundredsDigit * hundredsDigit)) 
        {
            document.write(num+"<br/>");
    }
    }
}
printDaffiodilNum();
<!DOCTYPE html> 
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script>
        var $a =7;
        document.write($a+ "<br/>");
    </script>
</head>
<body>
</body>
</html>