// reverse array with recursion javascript
let data = [5, 12, 65, 89, 0, 100]
let temp
function customReverse(data, start, end) {
if (start <= end) {
temp = data[start]
data[start] = data[end]
data[end] = temp
customReverse(data, start + 1, end - 1)
return data;
}
}
console.log(customReverse(data, 0, data.length - 1))
const arr = ["one", "two", "three"];
arr.reverse();
console.log(arr); // [ "three", "two", "one" ]