Being clear and concise: these are some of the marks of great code. As your projects grow they can get very messy, but one way we can offload code into "functions." Functions are self-contained bits of code that can be easily re-used. They often allow for "arguments" or parameters that are passed into them.
p5.js is actually full of functions: setup(), rect(), fill(), and console.log() are all functions you've used already! When we give rect() a position and dimensions, we're passing arguments to a reusable bit of code.
🖥 [ Ссылка ]
ALL THE VIDEOS IN THIS UNIT
🎥 [ Ссылка ]
CHALLENGES
❓ Can you make a function to compute the Pythagorean theorem? What input arguments do you need, and what variable type should it return?
![](https://i.ytimg.com/vi/Rhr3tE4p-2M/mqdefault.jpg)