title: how to reset javascript variable declared by keyword var?
body: <p>I have an 'init' function in which i have  few variables which i want to set as undefined/null on logout event.</p>
  
  <pre><code>var EmpCode;
  function initChat(user, usertoken, ip){ 
    if(user!= null){
      EmpCode = user;
      var time_id = Date.now();
  //some function calls.
  }
  
  function logout(){
  //reset variable
  }
  </code></pre>
  
  <p>i want to reset 'EmpCode' variable value on on logout function.</p>
  
  <p><code>delete EmpCode;</code> does not seems to work because it is defined by keyword var.</p>