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

Gets values from the right. 🏃 📼 📦 🌔

Similar: left, middle, right.

iterable.right(x, [n]);
// x: an iterable
// n: number of values (1)
const iterable = require('extra-iterable');

var x = [1, 2, 3];
[...iterable.right(x, 1)];
// [ 3 ]

[...iterable.right(x, 2)];
// [ 2, 3 ]

references

Clone this wiki locally