Calling Functions
You can call a function by using its name and supplying any needed parameters. Here is the general form of a function call:
A function call can make up an entire statement, or it can be used as a subexpression. Here is an example of a standalone function call:
In that example, the function foo
is called with the parameter 5.
Here is an example of a function call used as a subexpression:
Supposing that the function square
squares its parameter, the above example assigns the value 25 to a.
If a parameter takes more than one argument, you separate parameters with commas:
Last updated
Was this helpful?