function foo() { var a = 20 var b = 30 function bar() { debugger; return a + b } return bar; } var bar = foo(); bar();