mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2026-03-13 15:21:15 +08:00
feat: adjust swap grammar (#175)
* feat: adjust swap grammar * fix: grammar
This commit is contained in:
@@ -21,9 +21,7 @@ function selectionSort (items) {
|
||||
if (min !== i) {
|
||||
// After each pass, if the current min num != initial min num, exchange the position.
|
||||
// Swap the numbers
|
||||
var tmp = items[i]
|
||||
items[i] = items[min]
|
||||
items[min] = tmp
|
||||
[items[i], items[min]] = [items[min], [items[i]]]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user