title: JavaScript - using the users input as function call
body: <p>I'm working on a small javascript project. I'd like to receive a users console input and furthermore use the input to calculate some values.</p>
  <p>I capture the users input in a variable called <code>answer</code>.</p>
  <p>when using <code>console.log(answer)</code> the answer get printed.</p>
  <p>let's say the user's answer was <code>MILK</code></p>
  <p>my current (working and hardcoded) call looks something like this:</p>
  <pre><code>let p = 0;
  call.prices('MILKPRICE', (err, tic) =&gt; { p = tic.MILKPRICE; });
  </code></pre>
  <p>now I'd like to replace the word 'milk' with the user's answer</p>
  <pre><code>let p = 0;
  call.prices(answer+'PRICE', (err, tic) =&gt; { p = tic.answer+'PRICE'; });
  </code></pre>
  <p>which returns undefined. is there a way to actually use the user's input and not hardcoding all possible records?</p>
  <p>thank you very much</p>