Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/betomoedano/JavaScript-Coding-Interview-Questions
/ swap
Function
swap
sorting/quick-sort.js:39–43 ·
view source on GitHub ↗
(i, j, array)
Source
from the content-addressed store, hash-verified
37
}
38
39
function
swap(i, j, array) {
40
const
temp = array[j];
41
array[j] = array[i];
42
array[i] = temp;
43
}
44
45
const
array = [8, 5, 2, 9, 5, 6, 3];
46
console.log(quickSort(array));
Callers
1
quickSortHelper
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected