Skip to content

interpolate

Subhajit Sahu edited this page May 17, 2020 · 15 revisions

Estimates new values between existing ones. 🏃 [:vhs:] 📦 🌔 📒

iterable.interpolate(x, fn);
// x:  an iterable
// fn: combine function (a, b)
const iterable = require('extra-iterable');

var x = [1, 2, 3];
[...iterable.interpolate(x, (a, b) => (a + b)/2)];
// [ 1, 1.5, 2, 2.5, 3 ]
Clone this wiki locally