Description
Arithmetic operator: + - * / %
Comparison operator: == != > < >= <=
Logical Operator
(a == b) && (a == c)
t && t t
t && f f
f && t f
f && f f
||
t || t t
t || f t
f || t t
f || f f
! - not
!t - f
!f - t
Assignment Operator
a = a + 1 | a += 1
a = a * 1 | a *= 1
a = a / 1 | a /= 1
a = a - 1 | a -= 1
Increment Decrement Operator
++variable | variable++
--variable | variable--
a = 10;
c = ++a;
c = a++;
(a++ | ++a) | a = a + 1
(a-- | --a) | a = a - 1
|
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>internal</title>
</head>
<body>
<script>
var a=10;b=5;var c;var d;var e;var f=10;var j;var k;
c=a++;
d=--b;
e=--a;
f+=e;
j=(a==f);
k=(a>f);
document.write("result"+j||k+"<br>");//logical operator
document.write("j"+j+"<br>");//
document.write("c"+c+"<br>");
document.write("d"+d+"<br>");
document.write("e"+e+"<br>");
document.write("j"+j+"<br>");//Assignment operator
document.write("boolean"+Boolean(a>b)+"<br>");//boolean operator
</script>
</body>
</html>
|