title: Create a Javascript Callback function?
body: <p>i was wondering how to implement a callback into this piece of code</p>
  
  <pre><code>MyClass.myMethod("sth.", myCallback);
  function myCallback() { // do sth };
  </code></pre>
  
  <hr>
  
  <pre><code>var MyClass = {
  
  myMethod : function(params, callback) {
  
      // do some stuff
  
      FB.method: 'sth.',
         'perms': 'sth.'
         'display': 'iframe'
        },
        function(response) {
  
              if (response.perms != null) {
                  // How to pass response to callback ?
              } else {
                  // How to pass response to callback ?
              }
        });
  }
  </code></pre>
  
  <p>}</p>