![]() |
![]() |
|
Calling a functioncorresponds to asking a question (e.g.
What's the square root of 25or
What's the area of a 20-inch pizza?).
writing a functionis writing down the instructions to answer that question, whenever it gets asked in the future.
To call a function: methodName-openParen-arguments.
We've seen examples that return answers:
as well as examples which change some pixels on the screen, but don't return answers:
We can use the answer from one method as the argument to another (!):
Note that it does not make sense to write
This page licensed CC-BY 4.0 Ian Barland Page last generated | Please mail any suggestions (incl. typos, broken links) to ibarland ![]() |