Repository navigation
Expand file tree
/
Copy pathOperators.js
More file actions
85 lines (54 loc) · 1.81 KB
/
Copy pathOperators.js
File metadata and controls
85 lines (54 loc) · 1.81 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
72
73
74
75
76
77
78
79
80
81
82
83
/******* Arithmetic Operators ********/
// let x = 5;
// let y = 2;
// let result = x ** y;
// console.log('Result is : '+result)
// let a = 10
// let q = 2 * --a
// console.log('Value of q is : '+q)
// console.log('Value of a is : '+a)
/******* Assignment Operators ********/
// let x = 10;
// ///x = 10 + 20;
// x *= 5; // x = x * 5
// console.log('value of x is : '+x)
/******** Comparison Operations *********/
// let x = 11;
// let y = 12;
// console.log(x >= y);
/*
Ternary Operator : like if-then-else
takes 3 arguments
condition ? value if true : value if false
*/
// let result = x > y ? x : y
// console.log(result);
/******** Logical Operators *********/
// let A = true;
// let B = false;
// console.log((10>5) || (6<3));
/******** Type Operators *********/
// let firstName = 'Raghav';
// console.log (typeof firstName);
// console.log (typeof 123.34);
// console.log (typeof true);
// let lastName = new String('Pal');
// let num1 = new Number(123)
// console.log (num1 instanceof Number);
// console.log (typeof "Raghav"); // Returns "string"
// console.log (typeof 123); // Returns "number"
// console.log (typeof false); // Returns "boolean"
// console.log (typeof NaN); // Returns "number"
// console.log (typeof [1,2,3,4]); // Returns "object"
// console.log (typeof {name:'Peter', age:25} ); // Returns "object"
// console.log (typeof new Date()); // Returns "object"
// console.log (typeof null); // Returns "object"
// console.log (typeof function () {}); // Returns "function"
// console.log (typeof myClass); // Returns "undefined"
// console.log ('********* Bitwise Operators ***********');
// let A = 1;
// let B = 2;
// console.log (A & B);
// console.log (A | B);
// console.log (3^5);
// console.log (~5);