-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataTypes.js
68 lines (48 loc) · 1.15 KB
/
dataTypes.js
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
//data types
// loosly coupled and dynamic language
var myVar = 2;
myVar = 'Kumar';
// myVar = null;
// myVar = {name:"Akhilesh"};
// console.log(34n+12n);
// Data Type
// - Primitives
// - String
// - Number (3424453436456) -(2^53 - 1) +(2^53 + 1)
// - BigInt (23423423432434234n)
// - null
// - undefined
// - Boolean
// - Symbol
// - No-Primitives
// - Objects
// var str = "kumar";
// var normalStr = 'test';
// normalStr[2] = 'p';
// var arr = [1,2,3,4,5];
// arr[2] = 9;
// var stn = "my name is \vkumar \vsaurabh";
// var nums = [-10, 30, 20, 40, -60];
// function findMin(arr){
// var minNum = Number.POSITIVE_INFINITY;
// for(var i = 0; i<arr.length; i++){
// minNum = Math.min(minNum, arr[i]);
// }
// return minNum;
// }
// var sdfdsf = findMin(nums);
// console.log(sdfdsf);
// var num = 9007199254740994;
// console.log(typeof num);
var value1 = new Object('hello');
var value2 = new Object('hello');
// value = 'Akhilesh';
if(value){
console.log(`Hi ${value}`);
}else{
console.log(`Hi User`);
}
// console.log(value1 === value2);
var isValid = 0; //0
// isValid = true; //1
console.log(typeof isValid);