<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <script> function closure() { var inner_variable=3; return function(i) { return inner_variable*i; } } var _closure=closure(); alert(_closure); alert(_closure(5)); var man={ age:30, sex:"male", run:function() { alert("a "+this.sex + " is running"); } }; alert(man.age); man.run(); var sex="mars"; man.run.apply(window,[]); //alert(_closure.inner_variable); </script> </head> <body> </body> </html>