var sayHi; if(true){ sayHi = function(){ console.log("HI"); }; }else { sayHi = function(){ console.log("hhh"); }; }