We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd10c25 commit 7578f0bCopy full SHA for 7578f0b
public/data/javascript.json
@@ -803,12 +803,11 @@
803
"title": "Random string",
804
"description": "Generates a random string of characters of a certain length",
805
"code": [
806
- "function makeid(length) {",
807
- " const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';",
+ "function makeid(length, characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') {",
808
" return Array.from({ length }, () => characters.charAt(Math.floor(Math.random() * characters.length))).join('');",
809
"}",
810
"",
811
- "console.log(makeid(5));"
+ "console.log(makeid(5), \"1234\" /* (optional) */);"
812
],
813
"tags": ["javascript", "function", "random"],
814
"author": "kruimol"
0 commit comments