🧭First-Class Function
Also known as First-Class Functions, Functions as Values, First-Class Citizen
A function treated as a value. You can store it, pass it or return it.
Think of it like
It is like a recipe card you can hand around. You can keep it, pass it on or give it back.
Example
Why it matters
It lets you pass actions around like data. Sort rules, click handlers and retries all rely on it.
Definition
Example code
python
def shout(text):
return text.upper()
say = shout
print(say("hi"))
# HI