var definition = function (spec) { var that = {}; that.helloJsFiddle = function () { return "Hello JsFiddle and '" + spec.hello + "'"; }; that.setHello = function (helloTo) { spec.hello = helloTo; }; return that; }; // ***************************************** var instanceOne = definition({hello: "one"}); console.debug(instanceOne.helloJsFiddle()); var instanceTwo = definition({hello: "two"}); console.debug(instanceTwo.helloJsFiddle()); instanceOne.hello = "Try to overwrite"; console.debug(instanceOne.helloJsFiddle()); instanceOne.setHello("ONE"); console.debug(instanceOne.helloJsFiddle()); console.debug(instanceTwo.helloJsFiddle());