need array element at first
hi all
array=["starFilter","taFilter","dealsFilter","hoursFilter",.......,"showFewFilter"]
if (array.length>0 && array.indexOf("showFewFilter")>0){
//this time i wanto show my array["showFewFilter"] in first place
}
i tried like this
if(arr.length>0 && arr.indexOf("showFewFilter")>0){
var first =arr[0]
var index=arr.indexOf("showFewFilter")
arr[0]=arr[index]
arr[index]=first
}
is there any other way