There's an important difference though. With a regular "if" statement in synchronous code, if there is no else clause, that doesn't prevent the next line *after* the if from executing. With an "if" statement in synchronous code, every possible branch must eventually result in callback invocation, or the "next line" unrelated to the "if" condition will never execute.
On Mon, Sep 22, 2014 at 5:58 PM, Matt <[email protected]> wrote: > > On Sun, Sep 21, 2014 at 10:12 PM, Tom Boutell <[email protected]> wrote: >> >> Your "if" needs an else clause to ensure the callback is eventually >> invoked. > > > Yes I know - the original didn't either. I'm assuming because it wasn't the > entire actual code, more of an example. > > -- > Job board: http://jobs.nodejs.org/ > New group rules: > https://gist.github.com/othiym23/9886289#file-moderation-policy-md > Old group rules: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > --- > You received this message because you are subscribed to a topic in the > Google Groups "nodejs" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/nodejs/wBAJhYOzjqQ/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/nodejs/CAPJ5V2Z656%3DPvqT%3DOzdC2A_cOi%2B4EeKQkVeik7yyO2PGxAi7zw%40mail.gmail.com. > > For more options, visit https://groups.google.com/d/optout. -- THOMAS BOUTELL, DEV & OPS P'UNK AVENUE | (215) 755-1330 | punkave.com -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAORXhGJ79L7EL%3D7ZOCQ935RXFNGMUW%2B7JCdFey28LSDPhV9PFQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
