nazerke
7/23/2015 - 3:02 PM

modified_module_pattern.html

<!DOCTYPE html>
<html>
  <head>
<script>

var foo = (function(){
	var publicAPI = {
		bar: function(){
			publicAPI.baz();
		},
		baz: function(){
			console.log("baz");
		}
	};
	return publicAPI;
})();

foo.bar();		// "baz"

</script>

  </head>
  <body>
    <!-- page content -->
  </body>
</html>