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 7578f0b

Browse files
committed
changes
1 parent cd10c25 commit 7578f0b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

‎public/data/javascript.json‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,12 +803,11 @@
803803
"title": "Random string",
804804
"description": "Generates a random string of characters of a certain length",
805805
"code": [
806-
"function makeid(length) {",
807-
" const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';",
806+
"function makeid(length, characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') {",
808807
" return Array.from({ length }, () => characters.charAt(Math.floor(Math.random() * characters.length))).join('');",
809808
"}",
810809
"",
811-
"console.log(makeid(5));"
810+
"console.log(makeid(5), \"1234\" /* (optional) */);"
812811
],
813812
"tags": ["javascript", "function", "random"],
814813
"author": "kruimol"

0 commit comments

Comments
(0)

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