title: js, turn string to function
body: <p>I want to know how can i turn string into a wrap function.</p>
  
  <p>I have a string function data</p>
  
  <pre><code>var a = new String("alert(turned)");
  </code></pre>
  
  <p>And I want to turn a into a wrapped function</p>
  
  <pre><code>a = function(){ a }; // failed
  
  a = function(){ eval(a) };  // failed
  
  var b = a;
  
  a = function(){ eval(b) } // success
  </code></pre>
  
  <p>I want to know what do people will do in general to turn a into a wrapped function.</p>
  
  <p>Thank you very much for your advice.</p>