title: How can I write a function accepting callBack function and run it in a 'safe' way?
body: <p>I want to write such a function:</p>
  
  <pre><code>function doGoodJob(someId, callBackfunction){
  
  // some stuff with someId
  
  // todo: RUN callBackFunction here
  
  }
  </code></pre>
  
  <p>They say eval is 'dangerous' in terms of code injection.</p>
  
  <p>so, what is the best practice to write a JavaScript function that accepts a call-back function and runs it securely?</p>