странный массив
var name = new Array('Viktor', 'Daniil', 'Danislav','Osip', 'Ostap');
var family = new Array('Smirnov', 'Ivanov', 'Kuznecov', 'Popov', 'Sokolov');
var email = new Array('@gmail.com', '@tut.by', '@mail.ru', '@hotmail.com');
function getRegistr(){
var rnd = function(x){
return x[Math.floor(Math.random()*x.length)];
};
return {"name": rnd(name),"family": rnd(family),"email": rnd(email)};
};
var t = getRegistr();
alert(JSON.stringify(t));
|