FAQ: Node.js Essentials - User Input/Output

This community-built FAQ covers the “User Input/Output” exercise from the lesson “Node.js Essentials”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn Node.js

FAQs on the exercise User Input/Output

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!
You can also find further discussion and get answers to your questions over in #get-help.

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head to #get-help and #community:tips-and-resources. If you are wanting feedback or inspiration for a project, check out #project.

Looking for motivation to keep learning? Join our wider discussions in #community

Learn more about how to use this guide.

Found a bug? Report it online, or post in #community:Codecademy-Bug-Reporting

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

in ex.3 in the end I wrote “node app.js” and got an error

Me too. I literally have no idea what’s going on. This node.js minicourse is impossible to understand.

1 Like

I agree… This course is quite hard to understand even though I’m doing it slowly. We need more simplified explanations.

But I still wanna complete it anyway.

process.stdin.on(‘data’, playGame);

Why is the first of two entries for process.stdin.on, ‘data’ ? I cant find another ‘data’ anywhere in app.js or game.js. I checked on line and any examples I can find, they just use ‘data’ is well. is this merely convention or is it referencing another ‘data’ somewhere else in ‘process.’ ? What other entries can be used instead of ‘data’ and what do they do?

1 Like

One thing that was helpful for me was to watch Crash Course computer Science - it explains the background that is being used in node.js and other backend applications of languages.

Why does the game keep looping if we get the wrong number? And how does Node know to accept another number and to only quit program when we type quit of get the number correct?

I’m expecting to see some kind of a loop or more code that tells node to do that explicitly, but I don’t see it. I would expect to see it in the last if statement of the games.js else function. What an I missing or not understanding?

Why should I have to pass the function without invoking it (without the parentheses) to process.stdin.on('data', playGame);

Hi… how come process.stdin is an instance of EventEmitter?? i thought EventEmitter is in event module not in the process module?? thank you in advance

process.stdin.on is a HOF… a function that takes a function as an argument, that why we don’t need to invoke a function when it is an argument