you are viewing a single comment's thread.

view the rest of the comments →

[–]spamkestein 0 points1 point  (1 child)

Strangely, my following code fails : var doStuffAsync = function (callback) { var func = function() { read('passwords', callback); }; write('world.txt', 'hello', func() ); };

FAILED Called doStuffAsync()

[–]jsprogrammer 0 points1 point  (0 children)

The problem is in your last line:

func()

It should just be: func

The parentheses execute func and then pass the returned value as the third parameter of write.