Point-Free Style
Compose functions without naming arguments.
What Is Point-Free Style
Point-free (or tacit) style defines functions by combining other functions, without mentioning their arguments. The arguments are the implicit points being passed along.
function double(n) { return n * 2; }
const nums = [1, 2, 3];
// pointed: argument named explicitly
console.log(nums.map((n) => double(n))); // [2, 4, 6]
// point-free: no named argument
console.log(nums.map(double)); // [2, 4, 6]Passing Functions Directly
When a callback simply forwards its argument to another function, you can pass that function by name instead of wrapping it.
const len = (s) => s.length;
const words = ["a", "bb", "ccc"];
console.log(words.map((w) => w.length)); // pointed: [1, 2, 3]
console.log(words.map(len)); // point-free: [1, 2, 3]