# Functions as Values

A weekend discount as a true/false flag means the total's code changes with every new deal; functions as values let the caller hand in the rule instead: a function stored in a variable, passed to another function, or made and returned by one, in C#, Java, Python, JavaScript and TypeScript.

![Cheat sheet: Functions as Values](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/348ec2c9394f4e9884066cc10e3bb676.webp)

- Category: Data Structures
- Level: Apprentice
- Tags: c-sharp, First-Class Function, Higher-Order Function, java, JavaScript, OOP, python, typescript
- Author: Gregor Dzierzon
- Updated: November 17, 2026

Source: https://www.ask-codey.com/cheat-sheets/dp-functions-as-values-cheat-sheet
