Swift Functions
Functions are reusable blocks of code that perform specific tasks. They’re fundamental to organising your code, avoiding repetition, and making your programs easier to understand and maintain. Think of a function as a mini-program that takes some input, does something useful with it, and optionally gives you back a result. In Swift, functions are first-class citizens—you can pass them around, store them in variables, and use them just like any other data type. ...