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