Skip to content
Subhajit Sahu edited this page Nov 20, 2022 · 19 revisions

Get values from middle.

Similar: left, middle, right.


function middle(x, i, n)
// x: an array
// i: start index
// n: number of values [1]
const array = require('extra-array');

var x = [1, 2, 3];
array.middle(x, 1, 1);
// → [ 2 ]

array.middle(x, 1, 2);
// → [ 2, 3 ]


References

Clone this wiki locally