Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd1bd61e

Browse files
authored
Merge pull requestmgechev#120 from kdamball/patch-1
Swap the array values in Fisher-Yates using es6 deconstruction
2 parents099d4ba +47e36a4 commitd1bd61e

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

‎readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ If the build is not successful fix your code in order the tests and jshint valid
8383
:---: |:---: |:---: |:---: |:---: |:---: |
8484
[pkerpedjiev](https://github.com/pkerpedjiev) |[Xuefeng-Zhu](https://github.com/Xuefeng-Zhu) |[mik-laj](https://github.com/mik-laj) |[amilajack](https://github.com/amilajack) |[ysharplanguage](https://github.com/ysharplanguage) |[contra](https://github.com/contra) |
8585

86-
[<imgalt="liesislukas"src="https://avatars0.githubusercontent.com/u/2733862?v=3&s=117"width="117">](https://github.com/liesislukas) |[<imgalt="millerrach"src="https://avatars1.githubusercontent.com/u/12432794?v=3&s=117"width="117">](https://github.com/millerrach) |[<imgalt="fanixk"src="https://avatars1.githubusercontent.com/u/921156?v=3&s=117"width="117">](https://github.com/fanixk) |[<imgalt="shaunak1111"src="https://avatars0.githubusercontent.com/u/1323960?v=3&s=117"width="117">](https://github.com/shaunak1111) |
87-
:---: |:---: |:---: |:---: |
88-
[liesislukas](https://github.com/liesislukas) |[millerrach](https://github.com/millerrach) |[fanixk](https://github.com/fanixk) |[shaunak1111](https://github.com/shaunak1111) |
86+
[<imgalt="liesislukas"src="https://avatars0.githubusercontent.com/u/2733862?v=3&s=117"width="117">](https://github.com/liesislukas) |[<imgalt="millerrach"src="https://avatars1.githubusercontent.com/u/12432794?v=3&s=117"width="117">](https://github.com/millerrach) |[<imgalt="fanixk"src="https://avatars1.githubusercontent.com/u/921156?v=3&s=117"width="117">](https://github.com/fanixk) |[<imgalt="shaunak1111"src="https://avatars0.githubusercontent.com/u/1323960?v=3&s=117"width="117">](https://github.com/shaunak1111)|[<imgalt="kdamball"src="https://avatars0.githubusercontent.com/u/3318312?v=3&s=117"width="117">](https://github.com/kdamball) |
87+
:---: |:---: |:---: |:---: |:---: |
88+
[liesislukas](https://github.com/liesislukas) |[millerrach](https://github.com/millerrach) |[fanixk](https://github.com/fanixk) |[shaunak1111](https://github.com/shaunak1111) |[kdamball](https://github.com/kdamball) |
8989

9090
##License
9191

‎src/shuffle/fisheryates.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@
2020
functionshuffle(array){
2121
varsize=array.length;
2222
varrand;
23-
vartemp;
2423
for(vari=0;i<size;i+=1){
2524
rand=Math.floor(i+Math.random()*(size-i));
26-
temp=array[rand];
27-
array[rand]=array[i];
28-
array[i]=temp;
25+
[array[rand],array[i]]=[array[i],array[rand]];
2926
}
3027
returnarray;
3128
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp