-
Notifications
You must be signed in to change notification settings - Fork 1
middle
Subhajit Sahu edited this page Feb 3, 2021
·
17 revisions
Get values from middle.
function middle(x, i, n)
// x: an iterable
// i: start index
// n: number of values [1]
const xiterable = require('extra-iterable');
var x = [1, 2, 3];
[...xiterable.middle(x, 1, 1)];
// → [2]
[...xiterable.middle(x, 1, 2)];
// → [2, 3]