Skip to content

Commit d2c5024

Browse files
committed
Update consolidated snippets
1 parent 89acc0d commit d2c5024

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

public/consolidated/all_snippets.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,23 @@
16451645
"promises"
16461646
],
16471647
"author": "0xHouss"
1648+
},
1649+
{
1650+
"title": "Random string",
1651+
"description": "Generates a random string of characters of a certain length",
1652+
"code": [
1653+
"function makeid(length, characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') {",
1654+
" return Array.from({ length }, () => characters.charAt(Math.floor(Math.random() * characters.length))).join('');",
1655+
"}",
1656+
"",
1657+
"console.log(makeid(5), \"1234\" /* (optional) */);"
1658+
],
1659+
"tags": [
1660+
"javascript",
1661+
"function",
1662+
"random"
1663+
],
1664+
"author": "kruimol"
16481665
}
16491666
]
16501667
},

0 commit comments

Comments
 (0)