Types of javascript operators:
Arithmetic operators:mathematical calculations eg:(+),(-),(/),() exponentiation(*), increment(++), decrement(--)
Assignment operators: simple assignment(+), combined assignemtns((+=)
Comparision Operatorsequal to(==), strict equal to(===), not equal(!=), greater than (>), less than or equal to(<=)
logical operator:AND(&&), logical OR(||), logical NOT(!)
Ternary operatorconditional operator(condition ? value1:value2) that returs one of two values based on a condition.
pre increment and post increment:
1.substitute
2.operation
3.Increment
Above steps are only applicable for assign another variables only.
let num=20;
let num1=num++;
//num1=20++
//num1=20
//num+1=20=1=21
console.log(num,num1);
op:21,20
Conditions:
1.while:
If condition is true then execute the output.
2.Do...while:
if condition is true or false print the input one time. Then cjeck the condition.
3.For loop:
As same as do while. There count is defined in seperate line. But in for loop defined in same line
Top comments (0)