From d4da007f72821c74a481930602879042bedb63dd Mon Sep 17 00:00:00 2001 From: Kruimol <41127358+kruimol@users.noreply.github.com> Date: Tue, 31 Dec 2024 14:59:30 +0100 Subject: [PATCH 1/2] Change to the random string generator I made a mistake with pushing the new version. So this is the correct version --- public/data/javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/data/javascript.json b/public/data/javascript.json index c6e73a75..da4605c3 100644 --- a/public/data/javascript.json +++ b/public/data/javascript.json @@ -818,7 +818,7 @@ " return Array.from({ length }, () => characters.charAt(Math.floor(Math.random() * characters.length))).join('');", "}", "", - "console.log(makeid(5), \"1234\" /* (optional) */);" + "console.log(makeid(5, \"1234\" /* (optional) */));" ], "tags": ["javascript", "function", "random"], "author": "kruimol" From 35278fbc105a95398749bd03c28c454f244ba487 Mon Sep 17 00:00:00 2001 From: Kruimol <41127358+kruimol@users.noreply.github.com> Date: Tue, 31 Dec 2024 15:14:58 +0100 Subject: [PATCH 2/2] changes Added to String Manipulation --- public/data/javascript.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/public/data/javascript.json b/public/data/javascript.json index da4605c3..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" } ] },