Skip to content
Subhajit Sahu edited this page Feb 3, 2021 · 18 revisions

Get values from left.

Similar: left, middle, right.


function left(x, n)
// x: an iterable
// n: number of values
const xiterable = require('extra-iterable');

var x = [1, 2, 3];
[...xiterable.left(x, 1)];
// → [1]

[...xiterable.left(x, 2)];
// → [1, 2]


References

Clone this wiki locally