title: Is there a way to use readline in for loop?
body: <p>I'm trying to make a script that on input e.g &quot;5&quot; runs a readline question 5 times in a row. So if i put amount as 3, it should ask me 3 questions and will log answer 3 different times.</p>
  <p>I've tried this, but can't get it to work.</p>
  <pre><code>var readline = require('readline');
  var log = console.log;
  
  var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
  });
  
  
  rl.question(&quot;amounts to run&quot;, function(amounts){
  var i;
  for (i = 0; i &lt; amounts; i++){
      rl.question(&quot;how is your day? &quot;, function(answers){
          log(answers)
      })
  }
  });
  
  rl.close();
  </code></pre>
  <p>Thank you in advance!</p>