<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <script type="text/javascript"> function MarkBiBao() { var a = 1; return function () { alert(a); } } //当函数A返回函数B中,使用了函数A的局部变量,那么函数B就叫做闭包 var func = MarkBiBao(); </script> </head> <body> </body> </html>