Skip to content

Latest commit

 

History

History
43 lines (38 loc) · 1.25 KB

File metadata and controls

43 lines (38 loc) · 1.25 KB

Operators and Loops

Operators

The evaluates be by comparing value, the result will be true or false (in comparison or logical).

  • We have :
    • '=='
    • '!='
    • '!=='
    • '==='
    • '<'
    • '>'
    • '<='
    • '>='
  • The priority of parentheses must be observed'()'
  • from left to right

AND , OR , not

like: (var == '1' && var < '10')

AND , OR , not

Loops

loop

  • It works on checking the condition if it is true entry into the block.
  • type of loops:
    • for
    • while
    • do while

for

  • when you have a specific number of runs.
  • The most common.
  • The counter(var) often starts at zero.
  • Every time one counter increases.
  • When the condition becomes "f" out of the block.

while

  • The meter usually starts with 1.
  • The increase over the counter is in the block.
  • Statement 1: '= +' Used to add new content to var 'msg' every run.
  • Statement 2: Increase counter variable by 1.

Make sure not to fall into a trap of the infinity loop.🌝

infinity loop