Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Click here if you want to know how to create an user input in node.js! :)

+1 vote
asked 4 days ago by codenxn (1,190 points)

There might be a shorter way, but I found this line of code, and it helped me a lot:

const readline = require('readline').createInterface({

        input: process.stdin,

        output: process.stdout


readline.question("What ever you want to ask\n", variableName => {

         console.log(`sup {variableName}`)



Again, I think you can find shorter ways, but I found this on codecademy.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.