Back to Lo

Core Partialx

docs/data/core-partialx.md

1.53.0219 B
Original Source

Pre-binds the first argument of a function. Variants support functions taking from 2 up to 6 input parameters.

go
add := func(x, y int) int {
    return x + y
}
add10 := lo.Partial(add, 10)
sum := add10(5)
// 15