Using the instanceof operator, you can test if an object was created with a specific constructor function.
function Hero(){} var h = new Hero(); var o = {};
h instanceof Hero; true h instanceof Object; false o instanceof Object; true
Note that you don't put parentheses after the function name (don't use h instanceof Hero()). This is because you're not invoking this function, but just referring to it by name, as for any other variable.