摘要: 例如function a(){…} 那么a就是这个func的名称 如果var f = function a(){} 那么这个func依然是a,而f是一个引用。 如果var f = function(){} 这是个匿名函数,函数名为”。 除了IE之外,ff,sa,ch,op的函数都有name属性,比如a.name。 而IE下,我们只能调用函数的toString()属性,通过正则来获取。我们污染一下原型Function.prototype.getSelfName = function(){ return typeof this.name === ‘string’ ? this.name : /fu 阅读全文
posted @ 2012-09-12 16:03 GarrettZhu 阅读(637) 评论(0) 推荐(0)