title: Is there a way to create a function from a string with javascript?
body: <p>For example;</p>
  
  <pre><code>var s = "function test(){
    alert(1);
  }";
  
  var fnc = aMethod(s);
  </code></pre>
  
  <p>If this is the string, I want a function that's called fnc. And <code>fnc();</code> pops alert screen.</p>
  
  <p><code>eval("alert(1);")</code> doesnt solve my problem.</p>