Here is a variable and two functions for you to explore:
var a = [30,6,26,49,3,9,28];
The first function init(data)
reverses the data twice and slices out the first element. The output will be an array without the last element.
The second function last(data)
reverses the data once and slices out only the first element. The output will be an array with only the last element.
If you call both functions using the same variable like this:
init(a);
last(a);
You will notice that the output of the second function is unexpected due to the reverse operation inherited from the first function.
How can you use these functions sequentially while maintaining the original order of the variable?