var arr=[];
	
	for (var i=0;i<100;i++) {
		arr.push(i);
	}
	arr.sort(
		function(){
			return Math.random()-0.5;
		}
	);
	
	arr.length=10;
	console.log(arr);

数组封装indexof()方法

var arr=["字","你","字","哈"];
	
console.log(arrIndexof(arr,'字'));
	
function arrIndexof(obj,a,b,c){
  return obj.join("").indexOf(a,b,c);
};

  

相关文章:

  • 2021-11-20
  • 2021-12-27
  • 2022-12-23
  • 2021-11-30
  • 2021-12-20
  • 2022-12-23
  • 2021-09-05
  • 2022-03-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2021-12-29
相关资源
相似解决方案