function foo() { if ((this instanceof foo) === false) { console.log('not an instance, hence a reference!'); /* returns new object of this class, which will trigger runtime of this * function */ return new foo(); } else console.log('you have an instance?'); } var ref = foo; ref.call(ref); var inst = new foo();