title: Create code on using input? Javascipt GUI
body: <p>I'm programming a web-app on electron and need the app to do some stuff based on use input:</p>
  <p>basically, on a user input, my code saves <code>var string = &quot;stuff&quot;</code>
  then on another input it saves <code>var string = &quot;other_stuff</code>
  is it possible to</p>
  <p>#1 - detect how many times the user has inputted to get a var and save it using something like <code>var string_1 = &quot;stuff&quot;</code> and <code>var string_2 = &quot;other_stuff&quot;</code> etc</p>
  <p>#2 - when these buttons are pressed, create code within a loop (that will be ran on a buttonpress) that looks something along the lines of this</p>
  <pre class="lang-js prettyprint-override"><code>try{
    function('string_1');
  }
  catch (error)
    console.log(error);
  
  try{
    function('string_2');
  }
  catch (error)
    console.log(error);
  </code></pre>