Modify the function to return a copy of the given array inreverse order.
function copyAndReverseArray(array) {
}
/* Do not modify code below this line */
const original = [1, 2, 9, 8];
const reversed = copyAndReverseArray(original);
console.log(original, ‘<– should still be [1, 2, 9, 8]’);
console.log(reversed, ‘<– should be [8, 9, 2, 1]’);
Expert Answer
An answer will be send to you shortly. . . . .