Created
June 7, 2017 21:13
-
-
Save vinicius73/dcca3177e4c3eb672cf001c135951aae 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
const dic = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' | |
const randomInt = (max = 1000, min = 0) => Math.floor(Math.random() * (max - min)) + min | |
const randomString = () => dic.charAt(randomInt(dic.length -1, 0)) | |
const makeArray = (length, cb) => Array.from({ length }, cb) | |
const makeArrayOfStrings = length => makeArray(length, randomString) | |
const joiArr = lists => lists | |
.reduce((acc, arr) => { | |
return `${acc}${arr.join('')}` | |
}, '') | |
const makeLists = length => makeArray(length, () => makeArrayOfStrings(randomInt(10, 3))) | |
const st = joiArr(makeLists(2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment