๐—Ÿ๐—ผ๐—ผ๐—ฝ๐˜€ ๐—ฎ๐—ป๐—ฑ ๐—™๐˜‚๐—ป๐—ฐ๐˜๐—ถ๐—ผ๐—ป๐˜€ ๐—ถ๐—ป ๐—๐—ฎ๐˜ƒ๐—ฎ๐—ฆ๐—ฐ๐—ฟ๐—ถ๐—ฝ๐˜

Repeat tasks with loops.

Use a for loop when you know the number of repeats. It uses three parts:

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:

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