Reverse Arrays with reverse; The correct code won't work

Tell us what’s happening:

This code you see on the screenshot is supposed to be correct, am I right? Why is then not working for the second condition of the task?

Your code so far

var array = [1,2,3,4,5,6,7];
var newArray = [];

// Only change code below this line.

newArray = array.reverse(function() { return newArray; });

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.2988.0 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/reverse-arrays-with-reverse

the reverse() method does not take any arguments. You don’t need to include a function inside it.

1 Like