ssherman/Idol-Doc-Indexer — comment on commit a8fc3d4b207335126939612f6ab05dc789b2c8eb
File: test.js line 66
By jonpollock:

I would prefer that we use actual named functions when possible. For example, the function defined here, is created every second. If it was declared as a function it would not get re-created and garbage collected every second.

function message_received(result) {
var messages = ...
}

function poll() { sqs.call('ReceiveMessage', {'MaxNumberOfMessages':10}, message_received); }

setInterval(poll, 1000);

The poll function could still be anonymous, because it only gets defined once and executed every second.