05:28
<Mathieu Hofman>
lots of stuff depends on it matching; being functional is much rarer https://github.com/search?q=%28lang%3Ajs+OR+lang%3Ats%29+%22.constructor+%3D%3D%3D+Function%22&type=code
Why are people doing this instead of instanceof!?
05:31
<bakkot>
instanceof is syntax you'd have to learn whereas property access and === you learn on your first day
05:32
<bakkot>
(also I expect instanceof is slower though I doubt anyone doing this would actually know that)
05:32
<Mathieu Hofman>
Right but it's also the wrong check. It'd exclude AsyncFunction for example
05:32
<bakkot>
sometimes you want that! but yes
05:32
<bakkot>
I imagine a fair bit of this code predates AsyncFunction also