JavaScript Namespace Example

  • Post author:
  • Post category:JavaScript
<!DOCTYPE html>
<html>
<head>
<script>
	teamextension = {
		foo : 'Hi',

		bar : function() {
			alert(teamextension.foo);
		}
	}

	teamextension.foo = 'Hello';
	teamextension.bar();
</script>
</head>
<body>
</body>
</html>