UNPKG

@extra-array/interpolate

Version:

Estimates new values between existing ones.

11 lines (10 loc) 211 B
function interpolate(x, fc) { var a = [], u, i = -1; for (var v of x) { if (++i > 0) a.push(fc(u, v)); a.push(u = v); } return a; } export { interpolate as default };