Skip to content

reverse

Subhajit Sahu edited this page Feb 3, 2021 · 17 revisions

Reverse the values.

Similar: repeat, cycle, rotate, reverse.


function reverse(x)
// x: an iterable
const xiterable = require('extra-iterable');

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


References

Clone this wiki locally