Function
A series of instructions that are grouped and callable by a name. The primary components of a function are its:
- name
- parameter(s)
- return value
These three things together are called a function’s signature.
Below is an example Javascript function that adds two numbers:
|
|
Here is an example Kotlin function that finds the smallest value in a list:
|
|
Go, the programming language created by Google, permits multiple return values.