title: How to pass parameters to an eval based function inJavascript
body: <p>I am storing function body in string with function name.</p>
  
  <pre><code>function fnRandom(lim){
      var data=[];
      for(var i=0;i&lt;lim;i++)
      {
          data=data.concat(Math.floor((Math.random() * 100) + 1));
      }
  return data;
  }
  </code></pre>
  
  <p>After selecting the functionName from a drop down I use eval to execute function body.</p>
  
  <pre><code>JSON.stringify(eval(this.selectedFunction.body));
  </code></pre>
  
  <p>I want to pass <em>'lim'</em> to this execution or can I use functionName as initiating point for execution somehow?</p>