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.
Updated

- Category
- Data Structures
- Level
- Apprentice
- Tags
- c-sharp, First-Class Function, Higher-Order Function, java, JavaScript, OOP, python, typescript