3 ms·
And in JS is really easy to create an abstraction for this issue: function wait(o){ return setTimeout(function(){ o.action.call(o.this) },o.delay*100
by jQueryIsAwesome 14y ago
And in JS is really easy to create an abstraction for this issue:
function wait(o){
return setTimeout(function(){ o.action.call(o.this) },o.delay*1000)
}
To use it like this:
wait({
action : function(){ console.log(this) },
delay : 1,
this : this
});
- pixie_ 14y agoIf you're writing abstractions to avoid bad language features, maybe you shouldn't be using bad language features in the first place.