let arr = [1, 2, 3, 4, 5]; let reverseArray = (arr, left, right) => { if (left >= right) { console.log(arr); return; } //swapping first element to last element [arr[left], arr[right]] = [arr[right], arr[left]]; //callling the functio...
Markdown supported · ⌘↵ to post
No responses yet.