Functions

Key Concepts and Terminology

def vs. fn Functions

Type System

Function Arguments

Optional, Keyword, and Variadic Arguments

Coding Examples Explained

def Function Example

def greet(name: String) -> String:
    var greeting = "Hello, " + name + "!"
    return greeting