MCPcopy Create free account
hub / github.com/betomoedano/JavaScript-Coding-Interview-Questions / swap

Function swap

sorting/insertion-sort.js:16–20  ·  view source on GitHub ↗
(a, b, array)

Source from the content-addressed store, hash-verified

14}
15
16function swap(a, b, array) {
17 const temp = array[a];
18 array[a] = array[b];
19 array[b] = temp;
20}
21
22// variation with one-liner swap
23//

Callers 1

insertionSortFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected