Function.isFunction was a joke, I'm pretty sure that only very old legacy code deals with document.all and crazy stuff like that (however, it would be useful, but saving me from typing few more characters isn't something urgent or important).
On 10 Aug 2016 5:46 p.m., "Peter van der Zee" <[email protected]> wrote: > >> What's the issue with document.createElement('object')? > > > It's a callable exotic object. > > >> Function.isFunction? :D > > > typeof is what you are looking for. > > There is precedent (at least in IE [1]) for exotic functions where > `typeof` returned "unknown". Could happen for any exotic value unless > the spec changed on that. An `isFunction`, or rather, a simple > `isCallable`, may not be that far off the mark and is in line with the > existing `isArray`. Though I'd much rather have callables invariantly > locked down to being "typeof function". Even if that means explicit > exceptions to some legacy cases. > > - peter > > PS. Regexes in firefox were "callable" and had typeof function, but I > think that's so far back [2] it's not super relevant here. Of course > the same could be said about the IE case. > > [1]; one of many examples: > http://stackoverflow.com/questions/10982739/typeof-returning-unknown-in-ie > [2]; https://bugzilla.mozilla.org/show_bug.cgi?id=61911 >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

