Here is what I\'d like to do:
function a() { // ... } function b() { // Some magic, return a new object. } var c = b(); c instanceof b // -> true c
Someone posted an article by douglas crockford in this question, and it explains exactly what your asking.
OO Javascript constructor pattern: neo-classical vs prototypal