文章列表
status状态值
长整形标准http状态码,定义如下: Number Description
100 Continue
101 Switching protocols
200 OK
201 Created
202 Accepted
203 Non-Authoritative Information
204 No Content
205 Reset Content
206 Partial Content
300 Multiple Choices
301 Moved Permanently
302 Found
303 See Other
304 Not Modified
305 Use P ...
/**
* 降序排序整形数组
*/
function sortArr(arr){
for(var i=0;i<arr.length;i++){
for(var j=i+1;j<arr.length;j++){
if(arr[i]<arr[j]){
var temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
}
}
1.提高js for循环的运行效率
var arr=["a","b","c","d"];
var fromIndex = 0;
for(var i=fromIndex,ii=arr.length;i<ii;i++){
//code
}
循环时只须取一次数组长度。这个只有大量的循环时有效果。