mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 12:58:42 +08:00
Update the coding style for JavaScript (#329)
* Fix bug before commit 5eae708 * Update queue.md * Update the coding style for JavaScript --------- Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
@ -2647,8 +2647,8 @@ $$
|
||||
}
|
||||
// 随机打乱数组元素
|
||||
for (let i = 0; i < n; i++) {
|
||||
let r = Math.floor(Math.random() * (i + 1));
|
||||
let temp = nums[i];
|
||||
const r = Math.floor(Math.random() * (i + 1));
|
||||
const temp = nums[i];
|
||||
nums[i] = nums[r];
|
||||
nums[r] = temp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user