title: JavaScript : searching an array and returning value after user input
body: <pre><code>var data = [{
    id: 'A1',
    name: 'Minstrels'
  }, {
    id: 'A2',
    name: 'Bounty'
  }, {
    id: 3,
    name: 'Crunchie'
  }, {
    id: 4,
    name: 'bar'
  }];
  
  var rl = require('readline')
  
  var prompts = rl.createInterface(process.stdin, process.stdout);
  
  prompts.question('Which Product do you want to purchase? ',
    function(Answer1) {
      //missing code goes here in order to return Minstrels if the user 
      //types 'A1' etc..
    }
  )
  </code></pre>
  
  <p>I need help in my code. I have enabled user input and made an array, however, I can't think of what my code is missing.</p>