Function
also: functions
A named chunk of code that does one job. Other parts of the app can use it whenever that job needs doing, instead of repeating the same steps.
A reusable, named block of code that takes inputs (arguments), performs a task, and often returns a result. Functions let programmers avoid repetition and split programs into small, testable pieces. Functions attached to objects are often called methods.
A function is like the "latte" button on a coffee machine. You press it, it runs the same steps every time, and a latte comes out. You never redo each step by hand.
Agents often name the function they changed or created. Knowing a function is one small job helps you ask focused questions, like "which function calculates the total?"
The bug was in the formatDate function. It assumed every month has 31 days. I fixed it there, so every page that uses it is fixed too.
Find the function that decides whether a class is full, and explain what it checks before you change it.
Thinking a function is a feature of the app. A feature like "checkout" is usually built from many small functions working together.