-
Notifications
You must be signed in to change notification settings - Fork 0
/
day3.js
59 lines (52 loc) · 1.35 KB
/
day3.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
// Javasrcipt Operators
// Operators in JavaScript
// Operators are used to perform operations on variables and values.
// Assignment Operators(=,+=,-=,/=,*=)
let num = 10; // Assigned value 10 to num
console.log(num);
num += 10; // num = num + 10
console.log(num);
num -= 10; // num = num - 10
console.log(num);
num *= 10; // num = num * 10
console.log(num);
num /= 10; // num = num / 10
console.log(num);
// Arithmetic Operators
let a = 10,
b = 30;
console.log("The sum of two number is : ", a + b);
console.log("The difference of two number is : ", a - b);
console.log("The product of two number is : ", a * b);
console.log("The division of two number is : ", a / b);
console.log("The mod of two number is : ", a % b);
// Comparison Operators (>,<,>=,<=,==,!=)
let x = 10,
y = 20;
console.log(x == y);
console.log(x != y);
console.log(x > y);
console.log(x < y);
console.log(x >= y);
console.log(x <= y);
// Logical Operators
// && (AND)
// || (OR)
// ! (NOT)
(check1 = true), (check2 = false);
console.log(check1 && check2);
console.log(check1 || check2);
console.log(!check1);
// Bitwise Operators
// & (AND)
// | (OR)
// ~ (NOT)
// ^ (XOR)
// << (Left Shift)
// >> (Right Shift)
(numeber1 = 78), (number2 = 90);
console.log(numeber1 & number2);
console.log(numeber1 | number2);
console.log(~numeber1);
console.log(numeber1 ^ number2);
console.log(numeber1 << number2);