1 | Estimates new values between existing ones.
|
2 | [:package:](https://www.npmjs.com/package/@extra-array/interpolate)
|
3 | [:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array)
|
4 | [:running:](https://npm.runkit.com/@extra-array/interpolate)
|
5 | [:vhs:](https://asciinema.org/a/332071)
|
6 | [:moon:](https://www.npmjs.com/package/@extra-array/interpolate.min)
|
7 | [:scroll:](https://unpkg.com/@extra-array/interpolate/)
|
8 | [:newspaper:](https://nodef.github.io/extra-array/)
|
9 | [:blue_book:](https://github.com/nodef/extra-array/wiki/)
|
10 |
|
11 | > Similar: [interleave], [intermix], [interpolate], [intersperse].
|
12 |
|
13 | > This is part of package [extra-array].
|
14 |
|
15 | [extra-array]: https://www.npmjs.com/package/extra-array
|
16 |
|
17 | <br>
|
18 |
|
19 | ```javascript
|
20 | array.interpolate(x, fc);
|
21 | // x: an array
|
22 | // fc: combine function (a, b)
|
23 | ```
|
24 |
|
25 | ```javascript
|
26 | const array = require("extra-array");
|
27 |
|
28 | var x = [1, 2, 3];
|
29 | array.interpolate(x, (a, b) => (a + b)/2);
|
30 | // [ 1, 1.5, 2, 2.5, 3 ]
|
31 | ```
|
32 |
|
33 | [interleave]: https://github.com/nodef/extra-array/wiki/interleave
|
34 | [intermix]: https://github.com/nodef/extra-array/wiki/intermix
|
35 | [interpolate]: https://github.com/nodef/extra-array/wiki/interpolate
|
36 | [intersperse]: https://github.com/nodef/extra-array/wiki/intersperse
|