//arr1
var arr1 = new Array();
var arr2 = new Array();
for(var i = 0; i<40; i++){
arr1.push(i);
}
//console.log(arr1);
for(var k = 0; k<4;k++){
var id = Math.ceil(Math.random()*19);
if(arr2.indexOf(arr1[id]) === -1){
arr2.push(arr1[id]);
}else{
k= k - 1;
continue;
}
}
//console.log(arr2);