Skip to content

reverse$

Subhajit Sahu edited this page May 3, 2023 · 16 revisions

Reverse the values!

Alternatives: reverse, reverse$.
Similar: repeat, cycle, rotate, reverse.


function reverse$(x)
// x: an array (updated!)
const xarray = require('extra-array');

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

x;
// → [ 4, 3, 2, 1 ]


References

Clone this wiki locally