mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 01:18:23 +08:00
feat: adjust swap grammar (#175)
* feat: adjust swap grammar * fix: grammar
This commit is contained in:
@ -59,9 +59,7 @@ function getRandomInt (min, max) {
|
||||
}
|
||||
|
||||
function Swap (arr, x, y) {
|
||||
const temp = arr[x]
|
||||
arr[x] = arr[y]
|
||||
arr[y] = temp
|
||||
[arr[x], arr[y]] = [arr[y], arr[x]]
|
||||
}
|
||||
|
||||
// testing
|
||||
|
Reference in New Issue
Block a user