自分的にはおかしなコードは書いてないつもりでもきっと突込みがある・・・んじゃないかな
if( typeof Array.prototype.map === 'undefined') Array.prototype.map = function($callback){
var len = this.length;
var $_ = new Array(len);
for(var i =0; i<len; i++){
$_[i] = $callback.call(this,this[i],i);
}
return $_;
};
if( typeof Array.prototype.shuffle === 'undefined') Array.prototype.shuffle = function(){
return this
.map(function($_){return [Math.random(),$_]})
.sort(function(a,b){return a[0] - b[0]})
.map(function($_){return $_[1]})
;
};
第三引数がない