• You can't write code that blocks waiting for input. It needs to use callbacks.

    I'm not quite sure what you're trying to do, but this looks like it'd be an awful lot easier in JavaScript!

About

Avatar for Gordon @Gordon started