Calling or Invoking a Function
Parts of Calling or Invoking a Function
FunctionName(); // No arguments
FunctionName(x, y, size); // 3 argumentsArguments when calling
Other Use
float num = 1;
...
if (AddThree(num) < 5) { // Sees if the resulting number is less than 5
print(AddThree(num); // Prints the resulting number
}
...
// Creating the function can come after its use
float AddThree(float startNum) {
return startNum + 3;
}
Last updated