What are functions different from methods?
- Self-contained code that performs a specific task.
- Identified by their name to call whenever a task is required.
- To declare a function, use func.
- Use . -> to separate function parameters parenthesis and return type.
- Associated with a particular type.
- The first parameter name is given by default.
- Enumeration and Structure define methods.
Suggest An Answer
No suggestions avaliable!