You can pass it an anonymous function that invokes makeTimeout
with the given arguments:
setTimeout(function () {
makeTimeout(sp.name);
}, 250);
There's also an alternative, using bind
:
setTimeout(makeTimeout.bind(this, sp.name), 250);
This function, however, is an ECMAScript 5th Edition feature, not yet supported in all major browsers. For compatibility, you can include bind
's source, which is available at MDN, allowing you to use it in browsers that don't support it natively.
DEMO.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…