Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var letra = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
- var letra_o_numero,
- numero=0,
- string="";
- function id() {
- for(i=0;i<=5;i++){
- letra_o_numero = Math.floor(Math.random(5)*2);
- //si es 1, que el string sea una letra
- if (letra_o_numero == 1){
- string += letra[Math.floor(Math.random(5)*26)];
- }else{
- // si es 2, que escriba un numero
- numero = Math.floor(Math.random(5)*10);
- string += numero;
- }
- }
- // el String quedara de largo 15
- return string;
- }
Add Comment
Please, Sign In to add comment