Skip to content
Subhajit Sahu edited this page May 19, 2020 · 19 revisions

Gets values from middle. 🏃 📼 📦 🌔 📒

Alternatives: middle, middle$.
Similar: left, middle, right.

array.middle(x, [i], [n]);
// x: an array
// i: start index (0)
// 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