<!doctype html>
<html lang="en">
	<head>
		<title>JavaScript Patterns</title>
		<meta charset="utf-8">
	</head>
	<body>
		<button id="clickme">Click me: 0</button>
		<script>
			/* Title: Event Handling
			 Description: when you pass function A to function B as a parameter, function A is a callback function
			 */

			// antipattern
			/*var b = document.getElementById('clickme'),
			 count = 0;
			 b.onclick = function () {
			 count += 1;
			 b.innerHTML = "Click me: " + count;
			 };*/

			// preferred
	