Adding Methods to a JavaScript prototype: an Example