Skip to content

Commit

Permalink
Merge pull request #58 from kruimol/main
Browse files Browse the repository at this point in the history
Change to the random string generator
  • Loading branch information
Mathys-Gasnier authored Dec 31, 2024
2 parents d2c5024 + 35278fb commit 2c1ff11
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions public/data/javascript.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,19 @@
],
"tags": ["string", "tabs", "spaces"],
"author": "axorax"
},
{
"title": "Random string",
"description": "Generates a random string of characters of a certain length",
"code": [
"function makeid(length, characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') {",
" return Array.from({ length }, () => characters.charAt(Math.floor(Math.random() * characters.length))).join('');",
"}",
"",
"console.log(makeid(5, \"1234\" /* (optional) */));"
],
"tags": ["javascript", "function", "random"],
"author": "kruimol"
}
]
},
Expand Down Expand Up @@ -809,19 +822,6 @@
],
"tags": ["javascript", "sleep", "delay", "utility", "promises"],
"author": "0xHouss"
},
{
"title": "Random string",
"description": "Generates a random string of characters of a certain length",
"code": [
"function makeid(length, characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') {",
" return Array.from({ length }, () => characters.charAt(Math.floor(Math.random() * characters.length))).join('');",
"}",
"",
"console.log(makeid(5), \"1234\" /* (optional) */);"
],
"tags": ["javascript", "function", "random"],
"author": "kruimol"
}
]
},
Expand Down

0 comments on commit 2c1ff11

Please sign in to comment.