-
Notifications
You must be signed in to change notification settings - Fork 1
interpolate
Subhajit Sahu edited this page May 17, 2020
·
15 revisions
Estimates new values between existing ones. 🏃 📼 📦 🌔 📒
Similar: [interleave], [intermix], [intersperse], [interpolate].
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 ]