//外部的参数传参数,放到第三项及以后就可以
myArray = ['zero', 'one', 'two']; myArray.myMethod = function (sProperty) { console.log(arguments.length > 0 ? this[sProperty] : this); }; setTimeout(myArray.myMethod, 1500); //Window setTimeout(myArray.myMethod, 2000, 1); //undefined setTimeout((x)=>{ myArray.myMethod(x) //one },2000, 1);
标签:传参,setTimeOut,javascript,myArray,2000,参数,myMethod,setTimeout From: https://www.cnblogs.com/qutao125/p/16813077.html