Convert an object to a function
<p>How can I pass the variable param to the function?
My example doesn't work. The 'run' function throws an error = 'param is not defined'</p>

<pre><code>        var newClass = function (obj) {
            var param = "the param";
            var f = function (param) { };
            f.prototype = obj;
            return nf = new f(param);
        };

        var Runner = {
            run: function () {
                console.log("calling method run " + param);

            }
        };

        var nf = newClass(Runner);
        nf.run();
</code></pre>