JavaScript shared function pattern

This code demonstrates using JavaScript to instantiate a function that's shared between objects.  This is different to adding the function directly inside the object which means that the function's instance is independent to each object instance.

Test the code live here!

Published 18 February 2014 - -