JS Type and Prototype Sniffing
Additionally, it includes a subsequent test to determine whether a function is a functional prototype, and therefore something that would be suitable for calling with the
new operator. A value of
prototype is returned from the function in event that:
functionthrough Angus's previous logic
prototypeof the function has some keys defined on it. While this is not a conclusive test (suggestions definitely welcome) I think it covers most of the cases where people are using JS prototypes in their code.
As always, feedback would be greatly appreciated.