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

Commit 1627dd5

Browse files
Merge pull request #15 from loxt-nixo/patch-1
Added Shuffle Array function
2 parents 0aca506 + 226475a commit 1627dd5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎public/data/javascript.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@
2727
],
2828
"tags": ["javascript", "array", "flatten", "utility"],
2929
"author": "dostonnabotov"
30+
},
31+
{
32+
"title": "Shuffle Array",
33+
"description": "Shuffles an Array.",
34+
"code": [
35+
"function shuffleArray(array) {",
36+
" for (let i = array.length - 1; i >= 0; i--) {",
37+
" const j = Math.floor(Math.random() * (i + 1));",
38+
" [array[i], array[j]] = [array[j], array[i]];",
39+
" }",
40+
"}"
41+
],
42+
"tags": ["javascript", "array", "shuffle", "utility"],
43+
"author": "loxt-nixo"
3044
}
3145
]
3246
},

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /