title: JS Using onSuccess() syntax
body: <p>I have some code and I just see to be doing something wrong with the syntax.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>async mymethod(onSuccess, onFailure) {
      try {
          // Do some here
          onSuccess()
      }
      catch (e) {
          //this was an error
      }
  }
  </code></pre>
  
  <p>What I want to do is its <code>onSuccess()</code> I want to do something.</p>
  
  <p>Tried:</p>
  
  <pre><code>onSuccess((function() {
      // Do something
  }))
  </code></pre>
  
  <p>But there seems to be a syntax error.</p>
  
  <p>How do I use <code>onSuccess()</code> and do something with it?</p>