title: Javascript function implementation
body: <p>I have code like this :</p>
  
  <pre><code>(function() {
    $(document).ready(function() {
      //event handlers
      $('.project-delete').on('click', function() {
          deleteProject($(this));
      });
  
      $('.keyword-delete').on('click', function() {
          deleteKeyword($(this));
    });
    this.deleteKeyword = function(model) {
      }
  }).call(this);
  </code></pre>
  
  <p>I am curious if this is a good approach since I was learning JS recently and as far as I understand this function will have global scope, doesn't it ? since <code>.call(this)</code> is passing window object to this closure then I think it is not the best option ? Is there something I am missing ? Does changing <code>.call(this)</code> to just <code>()</code> change anything ?</p>
  
  <p>EDIT:So is it OK to just pass window object to that closure ? Wouldn't it better to pass just a empty object or jQuery object ?</p>