verdnatura-chat/e2e/helpers/random.js

9 lines
244 B
JavaScript
Raw Permalink Normal View History

2018-05-23 13:39:18 +00:00
function random(length) {
let text = '';
const possible = 'abcdefghijklmnopqrstuvwxyz';
for (let i = 0; i < length; i += 1) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
}
module.exports = random;