<!doctype html>
<html lang="en">
	<head>
		<title>JavaScript Patterns</title>
		<meta charset="utf-8">
	</head>
	<body>
		<script>
			/* Title: method() Method
			 Description: adding convenient functionality to a language
			 */

			if (typeof Function.prototype.method !== "function") {
				Function.prototype.method = function (name, implementation) {
					this.prototype[name] = implementation;
					return this;
				};
			}

			var Person = function (name) {
				this.name = name;
			}.
					method('getName