I saw this question, and I’m wondering what is the problem with this?
var id = 12;
setTimeout( showGrid ( 'i want to pass variable ' + id + ' here' ), 5000 );
I read the question I’m interested in what the code above is not a good solution. I’ve only Chrome installed, I’ve tried it and it works. Is there any browser issue with it?
Why the anonymous function is better?
You could use a closure:
And here’s a live demo.
edit(Milo) from the comments: