Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 2.11 KB

foreverAgrind.md

File metadata and controls

20 lines (12 loc) · 2.11 KB

This Feels Like Forever

Almost looks like you are stuck in a loop, right? Getting up, wash the face and do some pre-work duties. Get that work done and go back to sleep? Don't worry about that though, you can be assured that this loop is going to be different every day.

Looping in code however, means you need something done repetitively, exactly the same thing, until the objective is reached. Wether listing some details, making sure input is of the right value or writing whole HTML pages by looping over each prerequisite checked by customers. It is done mainly through two common statements, the for(a=0,a>b,a++){Do} and the while(a>b){Do}. Make sure to increment every while loop as it is not given to avoid being lost in The Infinity.

These statements have 3 common properties:

  • Initialization: where the variable is stated and given an initial value.
  • Condition: where the looping will happen, until it does not.
  • Update: which will save you from The Infinity.

Your condition is logical, and will always be either true or false. The comparison could be of 8 operators. ==, != means equal or not. ===,!== means strictly equal or not which checks both value and type of variable. >,< starts with the checked variable to the left which means greater or less and >=,<= includes the number/variable checked against to its right in the condition as greater or equal and less and equal.

Wait! don't forget about logical operators! These help combine your conditions to include more complex sets through &&,|| and ! not allowing you to be more precise in your operations.

It might look overwhelming and bleak. But just like the first explorers of jungles and oceans, you get to choose a path, and work on into it. So pick up your initial party of ships and company, check where you are in terms of knowledge space to make sure your conditions are suitable to get forward to the next loop update!

keep on going, along with the added complexity and don't be afraid of the code!