-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprimitiveDataTypes.html
More file actions
71 lines (57 loc) · 1.62 KB
/
primitiveDataTypes.html
File metadata and controls
71 lines (57 loc) · 1.62 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!-- 1st -->
<script>
let a=20;
let b=true;
let c=false;
let d=BigInt("543");
let e=null;
let f=undefined;
let g="ROLEX SIR";
let H=Symbol("Hello i Am Dilli");
h=H.toString();
document.write(a+"<br>"+b+"<br>"+c+"<br>"+d+"<br>"+e+"<br>"+f+"<br>"+g+"<br>"+h);
document.write("<br/>");
document.write("<br/>");
document.write(typeof a +"<br/>"+typeof b+"<br/>"+typeof c+"<br/>"+typeof d+"<br/>"+typeof e+"<br/>"+typeof f+"<br/>"+typeof g+"<br/>"+typeof H);
// output:20
// true
// false
// 543
// null
// undefined
// ROLEX SIR
// Symbol(Hello i Am Dilli)
// boolean
// number
// bigint
// boolean
// object
// undefined
// string
// symbol
</script>
<!-- 2nd usage of BigInt with Arthimetic Operators-->
<script>
let x=BigInt("543")+BigInt("7");
document.write(x);
// output:550
</script>
<!-- 3rd using PrimitiveData types as Objects -->
<script>
const powers={
"rolex" : true,
"dilli" : false,
"vikram" : undefined,
"amar" : 40,
"sandhanam" : BigInt("60")+BigInt("7"),
}
document.write(typeof powers);
document.write("<br/>");
document.write(powers["rolex"]+"<br/>"+powers["dilli"]+"<br/>"+powers["vikram"]+"<br/>"+powers["amar"]+"<br/>"+powers.sandhanam);
// output: object
// true
// false
// undefined
// 40
// 67(observe how i declared object sandhanam)
</script>