-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoperators.html
38 lines (30 loc) · 869 Bytes
/
operators.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<html>
<head>
<title> Default HTML</title>
<script type="text/javascript">
//Arithmetic
//comarision <, >,
//logical or relational
//assignment
//condition (ternary)
// sring operator - "+" is used to concate
//type operator - typeof and instanceof
//bitwise - &, |, ~, ^, <<, >>, >>>
//Addition
var a = 3; //right-to-left - associativity
var b = 3;
var c = 6;
var name = "Trupti"
var rs = a+b+c+name;
var rs1 = a+c+name+b; //left-to-right
var rs3 = a+b*c;
document.write(rs)
document.write("<br/>")
document.write(rs1)
document.write("<br/>")
document.write(rs3) //BODMAS
</script>
</head>
<body>
</body>
</html>