๐๐ผ๐ผ๐ฝ๐ ๐ฎ๐ป๐ฑ ๐๐๐ป๐ฐ๐๐ถ๐ผ๐ป๐ ๐ถ๐ป ๐๐ฎ๐๐ฎ๐ฆ๐ฐ๐ฟ๐ถ๐ฝ๐
Repeat tasks with loops.
Use a for loop when you know the number of repeats. It uses three parts:
- Start: Sets the counter.
- Condition: Checks if the loop runs.
- Step: Changes the counter.
Use a do-while loop for code needing at least one run. It checks the condition at the end.
Functions are reusable code blocks. They organize your work.
Learn parameters and arguments:
- Parameters: Placeholders in the definition.
- Arguments: Values you pass in.
Use default parameters for missing inputs. The function uses a pre-set value.
The return statement sends a result back. The function stops after this line.
Source: https://dev.to/kamalesh_ar_6252544786997/loops-and-function-10dd