title: How to make a wrapper function in javascript?
body: <p>I have a lot of click handler like below:</p>
  
  <pre><code>$(document).on('click','.xxxBtn', function(e){
      ....
  })
  </code></pre>
  
  <p>I want to action a cookies saving in some of them.<br>
  I can write like below:</p>
  
  <pre><code>function defaultHandler (e, callback) {
      callback(e);
      doSomeJobs();
  }
  
  $(document).on('click','.xxxBtn', defaultHandler(e,function(e){
      `diferent code in each Btn`
      ....
  })
  </code></pre>
  
  <p>But I think it would be nice to use a handle like(<strong>just look more nice and clear</strong>) :</p>
  
  <pre><code>$(document).on('click','.xxxBtn', defaultHandler(e){
      `diferent code in each Btn`
      ....
  })
  </code></pre>
  
  <p>Is it possible to achieve this?</p>
  
  <p><strong>update</strong><br>
  em, maybe my example is a little ambiguous. <br>I mean that if I can make a <code>defaultHandler</code> as what the <code>function statement</code> do in javascript? Just <code>function(e){...}</code> to  <code>defaultHandler(e){...}</code></p>