title: pass param to javascript constructor function
body: <pre><code>    function check_and_kill(selector){
          (function checkState(selector){
              if(selector.attr('type')){ 
                  return false;
              }else{
                  return true;
              }
          })(),
  
          kill = function(){
              if(this.checkState() == false){
                  console.log('kill all')
              }
          }
  
      }
  $('something').click(){
      check_and_kill($(this));
  }
  </code></pre>
  
  <p>I try to make checkState as my constructor, the the second function which is kill react depends on the value returned by the constructor, but I can't pass the selector, it return undefined. </p>