Javascripts/Typescripts reverse does reverse the elements of an array.
Is there a function that does this not to the array but returns a new array with reversed elements??
What it is:
let ary : number [] = [2,4,6];
ary.reverse ();
console.log (ary); // output: 6,4,2
What I want:
let ary : number [] = [2,4,6];
ary.reverse ();
console.log (ary); // output: 2,4,6
console.log (ary.reverse ()); // output: 6,4,2
Sure, it is not a bit effort to do it by myself but I would prefer an existing function.