Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/betomoedano/JavaScript-Coding-Interview-Questions
/ swap
Function
swap
sorting/bubble-sort.js:28–32 ·
view source on GitHub ↗
(a, b, array)
Source
from the content-addressed store, hash-verified
26
}
27
28
function
swap(a, b, array) {
29
const
temp = array[a];
30
array[a] = array[b];
31
array[b] = temp;
32
}
33
const
nums = [1, 3, 4, 5, 67, 4, 2];
34
console.log(bubbleSort(nums));
35
Callers
1
bubbleSort
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected