operators and loops
JavaScript includes operators as in other languages. An operator performs some operation on single or multiple operands (data value) and produces a result.
- Comparison Operators
JavaScript language includes operators that compare two operands and return Boolean value true or false.
== Compares the equality of two operands without considering type.
=== Compares equality of two operands with type.
!= Compares inequality of two operands.
Checks whether left side value is greater than right side value. If yes then returns true otherwise false. < Checks whether left operand is less than right operand. If yes then returns true otherwise false. = Checks whether left operand is greater than or equal to right operand. If yes then returns true otherwise false. <= Checks whether left operand is less than or equal to right operand. If yes then returns true otherwise false. # loops JavaScript supports different kinds of loops: for - loops through a block of code a number of times. for/in - loops through the properties of an object. for/of - loops through the values of an iterable object. while - loops through a block of code while a specified condition is true
- the main difference between main and while the structer of each loop the secound one is when i dont know ho many time the loop is