Files
test-repo/tests/js/partial-application/test.js
T
2020-05-08 00:55:46 +08:00

11 lines
296 B
JavaScript

const addOne = add(1, ?); // apply from the left
addOne(2); // 3
const addTen = add(?, 10); // apply from the right
addTen(2); // 12
// with pipeline
let newScore = player.score
|> add(7, ?)
|> clamp(0, 100, ?); // shallow stack, the pipe to `clamp` is the same frame as the pipe to `add`.