diff --git a/public/data/javascript.json b/public/data/javascript.json index c6e73a75..ac4d9ece 100644 --- a/public/data/javascript.json +++ b/public/data/javascript.json @@ -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" } ] }, @@ -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" } ] },