Array.prototype.map = function(fn) { var r = []; var l = this.length; for(var i = 0; i < l; i++) { r.push(fn(this[i])); } return r; };
为什么Firefox说:
not well-formed file:///some/path.html Line: 5 for(var i = 0; i < l; i++) { -------------------^
UPDATE
只有在为页面打开Firebug时才会显示错误.