Determine if a value is Callable/Constructible

Axel Rauschmayer axel at rauschma.de
Mon Mar 30 17:33:24 UTC 2015


>> In some way, that would even be correct – depending on what you expect a function to be: something callable or something constructible. Alas, there is currently no simple way to distinguish “callable” and “constructible”.
> 
> Why do you say they're not callable?


As in “makes sense to call”. In the past, `typeof x === 'function'” was an adequate test for checking whether it makes sense to call `x`. Since ES6, it isn’t, anymore. That’s why the checks proposed by Caitlin will be nice to have.

-- 
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150330/2a21ab47/attachment.html>


More information about the es-discuss mailing list