<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>YDKJS up & going</title>
		<script type=text/javascript charset=utf-8>

		var fn;
		function foo() {
			var a = 2;
			function baz() {
				console.log( a );
			}
			fn = baz; // assign baz to global variable
		}

		function bar() {
			fn(); // look ma, I saw closure!
		}
		foo();
		bar(); // 2

		</script>
	</head>
	<body>
		<div>Div here!</div>
	</body>
</html>
