function sayHello(name) { var sayAlert; { var text = 'Hello ' + name; sayAlert = function() { alert(text); } } var text='How confused am I?'; sayAlert(); } sayHello('Bob'); ---> "How confused am I?"