MCPcopy Create free account
hub / github.com/nodejs/node / swap

Function swap

deps/v8/tools/clusterfuzz/js_fuzzer/random.js:29–31  ·  view source on GitHub ↗
(array, p1, p2)

Source from the content-addressed store, hash-verified

27}
28
29function swap(array, p1, p2) {
30 [array[p1], array[p2]] = [array[p2], array[p1]];
31}
32
33/**
34 * Toggle a boolean flag with a probability.

Callers 2

twoBucketSampleFunction · 0.70
shuffleFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected