trim是一个String对象的方法,直接使用String不能够调用,就用一个原型实例来调用咯。如:function String(name){ ...this.name = name;this.trim = function(){ alert(this.name);} } var str1 = new String('haha');var strs = new String('heihei');str1.trim();弹出haha;str2.trim...
js中caller是什么意思 说明 1、caller是函数对象的一个属性,它指向调用当前函数的函数,例如A调用B,B.caller指向A()。...实例 function fun(){ console.log(argument.callee.caller); //argument.callee.caller必须写在...