Created
July 8, 2019 13:24
-
-
Save valex/e694ee4a76558a7f02282ae38e2679a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var alphabet = "абвгдеёжзийклмнопрстуфхцчшщъыьэюя"; | |
var max_num_of_symbols = 6; | |
var num_of_symbols = 0; | |
var randomString = ""; | |
console.log("alphabet.length = ", alphabet.length); | |
while(num_of_symbols < max_num_of_symbols){ | |
var index = Math.floor(Math.random() * alphabet.length); | |
randomString += alphabet[index]; // randomString = randomString + alphabet[index]; | |
num_of_symbols++; | |
} | |
console.log("randomString = ", randomString); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment