Higher-order function là hàm nhận hàm khác làm argument hoặc trả về hàm.
Ví dụ: map(), filter(), reduce() là HOF nhận callback. Hàm tạo middleware trong Express cũng là HOF. HOF là nền tảng của lập trình hàm (functional programming) trong JavaScript.
A higher-order function is a function that takes another function as an argument or returns a function.
Example: map(), filter(), reduce() are HOFs that accept callbacks. Express middleware factories are also HOFs. HOFs are the foundation of functional programming in JavaScript.