4 * <script type="text/javascript">
7 Array.prototype.filter = function(fun /*, thisp*/)
10 if (typeof(fun) != "function")
13 var res = new Array();
14 var thisp = arguments[1];
16 for (var i = 0; i < len; i++)
19 var val = t[i]; // in case fun mutates this
20 if (fun.call(thisp, val, i, t))
28 Array.prototype.map = function(fun /*, thisp*/)
30 var len = this.length;
31 if (typeof(fun) != "function")
34 var res = new Array(len);
35 var thisp = arguments[1];
36 for (var i = 0; i < len; i++)
39 res[i] = fun.call(thisp, this[i], i, this);
45 if (typeof(Array.prototype['lastIndexOf']) == 'undefined')
47 Array.prototype.lastIndexOf = function(elt /*, from*/)
49 var len = this.length;
51 var from = Number(arguments[1]);
64 for (; from > -1; from--)
66 if ((typeof(_t[from]) !== 'undefined') &&