I have a case where I check if a variable is undefined. in some instances I would like to turn the variable undefined again, so that it returns as undefined? Would this be considered bad practice?
:D/ code sample!
if (loc1 == undefined){
loc1 = loc.title
}
else if(loc2 == undefined){
loc2 = loc.title
}
else{
//here I want loc1 and loc2 to turn undefined again!
}
You can just do this: