Every program you write will eventually contain repeated logic — the same calculation, the same formatting, the same decision — appearing in more than one place.
Functions solve this problem. A function gives a block of code a label so that you can run it whenever you need it, from as many places as you like.
Please download the playground, try each playground page, while sharing progress and taking notes in your portfolio as you go.