operators
let a = 2;
let b = 4;
// arithmatic operator
//addition
console.log(a+b);
//subtraction
console.log(a-b);
//multiplication
console.log(a*b);
//power
console.log(a**b)
// modulas
console.log(a%b);
// reletional operator
// greater than
console.log(a>b)
// less than
console.log(a=b)
// equality operators
// equal to
console.log(a==b)
//not equal to
console.log(a!=b)
// strictly equal to
console.log(a===b)
//strictly not equally
console.log(a!==b)
// bitwise shift operator
// Decimal Binary
// 5 00000000000000000000000000000101
// 5 << 1 00000000000000000000000000001010 (10)
console.log(a<>b) //right shift
console.log(a>>>b) //unsigned right shift
//binary bitwise oerators
console.log(a&b) // and
console.log(a|b) // or
console.log(a^b) // xor
//binary logical operator
console.log(a&&b) // and
console.log(a||b) // or
console.log(a??b) // The latter returns the right-hand side operand if the left operand is any falsy value, not only null or undefined. In other words, if you use || to provide some default value to another variable foo, you may encounter unexpected behaviors if you consider some falsy values as usable
//terniary
//(condition ? ifTrue : ifFalse)
a>b ? console.log("a>b") : console.log("a
console.log(a++)
console.log(++a)
console.log(a--)
console.log(--a)