国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

JavaScript? ???

JS ???

??? ??? ????? ?? ?? ?? ??? ???? ???.


?? ???: +, -, *, /, %, ++, --

A = 10 + 20;

A = 10 – 20;

A = 10 * 20;

A = 10 / 20;

(1) "%" ??? ???, ? ??? ??? ???? ????.

A = 10 % 3; // A = 1, ???? 0? ??? ?? ????? ????.

A = 10 % 2 // A = 0, ???? 0?? ? ???


?? ?? ? ????. (2) "++" + 1 ???, ?? ?? 1

“++”? ???(++i) ?? ???(i++)? ??? ? ????.

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>php.cn</title>
        <script>
           var a = 1;
           var b = 1;
           document.write(++a);
           document.write("<hr>")
           document.write(b++);
        </script>
    </head>
    <body>
    </body>
</html>

? ??? ??? ?????

  • ++a? ?? ?? ?? ??? a=a+? ?????. ?? 1. ?? ?? ???? ?? ?? ? ??? ?? ?? ? ?? ??? ???? ????? ? ???? ??? a=a+1? ??? ?? ? ???? ?????

  • (3) "--" ?? 1 ???, 1? ??

  • "--"? ???(--i) ?? ???(-)? ??? ? ????. ?--).

'--' ??? '++' ??? ?????. ?? ???? ???.

?? ???: =, +=, -=, *=, /=


“+= " ?? ???? ??? ?????. ?: a += 10 //?? ? a = a + 10“-=" ?? ? ?? ?????. ?: a -= 10 //?? ? a = a - 10
"*=" ?? ?? ?? ?????. ?: a *= 10 //?? ?, a = a * 10

“/=” ?? ??? ?????. ?: a /= 10 //?? ? a = a / 10

??? ???: +, + =


???? "??" ??? ??? ? ??? ?? ??? ??? ? ????.

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>php.cn</title>
        <script>
           var name = "php.cn";
           var str = "歡迎來到"+name;
           document.write(str);
        </script>
    </head>
    <body>
    </body>
</html>

?? ???: >, <, >=, <=, ==, !=, ===, !==

?? ???? ??? ?? ?(true ?? false)???. A = 10 > 20; ????????? // ?? A=false %2 == 0; // ?? A=true

A = 10%2 == “0” ; // ?? A=trueA = 10%3 != 0; //?? A=true

A = 10%2 === “0”; =false

??:

“="? ?? ?????. ?: a = 10

“==”? ????. ??? ???? ? ??? ?? ?????. ?? ???? true? ????, ??? ??? false? ?????.

'==='? ?? ?????. ? ? ??? ???? ??? ?????. ??? ?? ???? true? ????, ??? ??? false? ?????.

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>php.cn</title>
        <script>
        //比較字符串?dāng)?shù)值和數(shù)值
           var name1 = "520";
           var name2 = 520;
        document.write(name1==name2);
        document.write("<hr>");
        document.write(name1===name2)
        </script>
    </head>
    <body>
    </body>
</html>


?? ???: &&, ||, !

?? ????? true ?? false?? ? ?? ??? ????.

'&&' ?? AND(? ??). ??? ??? ????? ?? true?? ??? true??, ??? ??? ??? false???.

??? AND? ? ??? ??? ??? ? ??? true?? ?????.

rree

"||" ?? OR. ??? ??? ? ?? ?? ? ???? ???? true? ????, ??? ??? false? ?????.

???

“!” !true = false , !false = true , !100 = false

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>php.cn</title>
        <script>
        //給一個成績
        var score=61;
        //判斷成績所屬級別
        if(score<60){
            document.write("對不起,您沒有及格");
        }else if (score>=60&&score<70){
            document.write("您剛好及格");
        }
        </script>
    </head>
    <body>
    </body>
</html>

?? ???: ?:

?? "?? ???"? ? ?? ????? ?????.

??: ???? ?? 1: ?? 2

??: ???? 1? ???? 2: ???? 3

??: ??? true?? ??? ?????. "?? 1"? ?? ??? ???? "?? 2"? ??? ?????.

?? ?? ???? if else? ??? ?????. (??? ??? ?? ??? ??????)

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>php.cn</title>
        <script>
        var age=79;
        if(age<10||age>60){
            document.write("您好,您符合我們店的優(yōu)惠條件,今天買東西全場5折");
        }else if (age>=10&&age<=60){
            document.write("不好意思,您不符合我們店的優(yōu)惠條件,今天買東西不享受折扣");
        }
        </script>
    </head>
    <body>
    </body>
</html>


???? ??
||
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>php.cn</title> <script> var a = 1; var b = 1; document.write(++a); document.write("<hr>") document.write(b++); </script> </head> <body> </body> </html>