Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. randomString: function () {
  2. var result = '';
  3. var words = 'qwertyuiopasdfghjklzxcvbnm';
  4. var max_position = words.length - 1;
  5. var i, position;
  6. for (i = 0; i < 5; ++i) {
  7. position = Math.floor(Math.random() * max_position);
  8. result = result + words.substring(position, position + 1);
  9. }
  10. return result;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement