JavaScript shared function pattern

Feb 18, 2014  

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!