How to make a function that will check if it is called with new keyword or a normal function?
Anonymous
function x(y) { if (this.constructor == x) alert['called with new'); else alert['called as function'); }
Check out your Company Bowl for anonymous work chats.