Given this code:
var x=5;
var fx=function(){
console.log("hey");
(function(){
if (x==5){
console.log('hi');
return;
}
})();
console.log('end');
};
fx();
How do I return in such a way that the final console.log is not executed when x==5?
I am new to javascript, so maybe I missed something...