Course Solutions Uncategorized (Solved) : Modify Function Return Copy Given Array Reverse Order Function Copyandreversearray Array M Q37457428 . . . .

(Solved) : Modify Function Return Copy Given Array Reverse Order Function Copyandreversearray Array M Q37457428 . . . .

 

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. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post