132   JS

function getRandInArray(arr,i){
	if(i<=0){
		return [];
	}
	var hadKey=[];
	var randVal=[];
	var j = 0;
	var r = 0;
	var len = arr.length;
	while(j=i){
			break;
		}
	}
	
	return randVal;
}
var item = [1,2,3,4,5];
var one = getRandInArray(item,1);
var two = getRandInArray(item,2);
console.log(one);
console.log(two);



Leave a Reply

Your email address will not be published. Required fields are marked *