Instructions:
In this kata you will create a function that takes in a list and returns a list with the reverse order.
Examples (Input -> Output)
- [1, 2, 3, 4] -> [4, 3, 2, 1]
- [9, 2, 0, 7] -> [7, 0, 2, 9]
Thoughts:
For this requirement arrays has the reverse() method, that reverse the array/list.
Solution:
function reverseList(list) {
return list.reverse();
}
Top comments (0)