Write a function reverse that reverses the given list in place.
Here is the specification:
// Reverses the given list, xs, in place.
// Thus, if an element e was at the index i in the list before applying the function,
// it will be at the index xs.length-1-i after the function returns.
function reverse(xs)
{
// your code
}
Write a function
reverse
that reverses the given list in place.Here is the specification:
How will you test your function?