<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> js的运算符 </title>
<script type="text/javascript">
var x = 10;
var y = 25;
var a1 = x + y;
var a2 = x - y;
var a3 = x * y;
var a4 = x / y;
/*window.alert (a1);
window.alert (a2);
window.alert (a3);
window.alert (a4);*/
//编写一个程序,判断两个数能否整除
var num1 = 11;
var num2 = 2;
var son = num1 % num2;
window.alert (son);
</script>
</head>
<body>
</body>
</html>
小结:
1.运算符基本和iOS一样,但是%叫膜;
翻译
%:膜;
alert:警报 在程序里弹出对话框;