<script> console.log(getUrlArr()); function getUrlArr() { var arr = []; var url = "http://192.1.1.1:1111/test.html?a=1&b=2&c=3&d=4"; var str = url.split("?")[1]; var arr1 = str.split("&"); for (var i = 0…
var a = ["2013-01","2013-01","2013-02","2013-02","2013-02","2013-03","2013-03"]; Array.prototype.del = function() { var a = {}, c = [], l = this.length; for (var i = 0; i < l; i++) {…
/****************************************************************** find the biggest x number in a sequence* the basic method is the same as the QuickSort** 1. move the smaller one before the pivot* 2. move the bigger one after the pivot* 3. determin…
1.代码如下: var toObject = function(a) { var o = {}; for (var i=0, j=a.length; i<j; i=i+1) { // 这里我调整了下, YUI源码中是i<a.length o[a[i]] = true; } return o; } var keys = function(o) { var a=[], i; for (i in o) { if (o.hasOwnProperty(i)) { // 这里, YUI源码中是lang.h…