Skip to content

on

Summary

Apply f to the result of g(a) and g(b).

Tip

This function is curried.

Examples

Building a case-insensitive string comparison function.

1
2
3
4
const streqi = on(eq, lower); // i.e. (a, b) => eq(lower(a), lower(b))

streqi('FOObar', 'fooBAR');
//=> true

Parameters

Name Type Description
f function Binary function.
g function Unary function.
a ? Any value.
b ? Any value.

Return

?