> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baenninger.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Funktionen

Funktionen sind wiederverwendbare Codeblöcke, die eine bestimmte Aufgabe ausführen. Sie helfen, den Code strukturierter und übersichtlicher zu machen.

```javascript theme={null}
function add(a, b) {
  return a + b;
}

function greet(name) {
  console.log("Hello " + name); // Hello Levin
}

function randNum() {
  return Math.floor(Math.random() * 10) + 1;
}

let sum = add(2, 1);
greet("Levin");
let randNum = randNum();
```
