When using setTimeout, you have to put the code you want to execute into a string:
setTimeout
setTimeout(\'alert(\"foobar!\");\', 1000);
Who said that it doesn't let you do it?
It does, the code -
setTimeout(function() { myFunction(); }, 1000);
is perfectly valid.