written in response to this question on Twitter, but hopefully this is helpful to someone, somewhere, in some small way.
Rather than cover what a function is and how it works, this example dives right into examples to illustrate the basics. If you need to do some research first, just remember: StackOverflow and Google are your best friends. Just take your time, and whenever you're ready this example will be right here waiting for you!
Let's get started!
Remember algrebra, as in 3 * x = 6
? Let's create a function that is capable of calculating a known value, 3
against an unknown value, x
: