var name = 'Mr. Bond';
(function(){
if(typeof name === 'undefined'){
var name = "Mr. Bond";
sayHello(name);
} else {
alert(name);
}
})();
function sayHello(name){
alert('hello, ' + typeof name !== 'undefined'? name: 'Mr. Robert!');
}
What this alerts? And, give me the reason for that.
Do you want me to shout the answer and kill the puzzle ?? ;)
ReplyDelete