setTimeout, objects, and anonymous functions

In conversation with Dunstan last night, I was advised of the facility in JavaScript’s setTimeout to pass a function, rather than a string, and have that function executed after the timeout. Did everyone else already know about this? I’ve been fighting the “how do I get my object into a string? oh, I guess I’ll make it a damned global variable” thing for years! Why didn’t anyone tell me this? JavaScript FAQTS has more.

More in the discussion (powered by webmentions)

  • (no mentions, yet.)