美文网首页
Day.02.26 js之赋值运算符

Day.02.26 js之赋值运算符

作者: 挂树上的骷髅怪 | 来源:发表于2017-02-26 12:47 被阅读16次
    <!DOCTYPE html>
    <html>
     <head>
     <meta  charset="utf-8">
      <title> 逻辑运算符 </title>
        <script type="text/javascript">
            var num1 = 10;
            num1 += 100;//num1 = num1+100;
            window.alert (num1);
    
            var num2 = 10;
            num2 -= 100;//num2 = num2- 100;
            window.alert (num2);
    
            var num3 = 10;
            num3 *= 100;//num3 = num3 * 100;
            window.alert (num3);
    
            var num4 = 10;
            num4 /= 100;//num4 = num4  / 100;
            window.alert (num4);
    
            var num5 = 10;
            num5 %= 100;//num5 = num5 % 100;
            window.alert (num5);
            
            var a = 56;
            var b = 90;
            a -= 34;//a = a -34 = 22;
            b %= a;//b = b / a 的余数 = 90 /22的余数 = 2
            window.alert (a);
            window.alert (b);
    
        </script>
     </head>
     <body>
     </body>
    </html>
    
    j1.png j2.png j3.png j4.png j5.png j6.png j7.png

    相关文章

      网友评论

          本文标题:Day.02.26 js之赋值运算符

          本文链接:https://www.haomeiwen.com/subject/xcpowttx.html