//查找制定元素在数组中的索引值
Array.
prototype.
indexVf=
function(
arr){
for(
var
i=
0;
i<
this.
length;
i++){
if(
this[
i]==
arr){
return
i;
}
}
}
var aa = [1,2,3,4,5];
aa.indexVf(1) //得到1在aa中的下标0