I have a js object that could be a function or a class, ie. it is equal to one of:
class {
constructor( param ) { }
onCreate() { }
};
Or,
function ( param ) { };
Turns out they have more in common then I expected (eg. both have a constructor). Please tell me the simplest way to determine which of these types my js object refers to.
The solution must work in node 4.3.2.
edit: To clarify, the object that I'm trying to differentiate is a class or a function, not an instance of these. And yes, I'm aware that a class is just syntatic sugar, that's what is making this difficult.