> You already can't assume the result is `typeof new function () { return value 
> } === "object"`

Yes, that's why I need reliable ways to test whether a value is an object, and 
your proposal breaks one of these.

> here's what I usually do:
>
> ```
> function isObject(value) {
>     return value != null && (
>         typeof value === "object" ||
>         typeof value === "function"
>     )
> }

No, `typeof` is not reliable, because it's implementation-defined for 
non-standard non-callable exotic objects.

For example, old IE used to return `"unknown"` in various cases.

-- Oriol



_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to