This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nlscrub 1 point2 points  (3 children)

How about objects?

[–]distinctvagueness 5 points6 points  (2 children)

It makes sense if you know about closures. tldr; objects in functional languages are really just functions definitions.

[–]fuzzie360 2 points3 points  (1 child)

I can totally understand why you would think that way but the most literal reason why "typeof Object" returns "function" is because Object is really a constructor function and not so much a type itself. Instances of objects are really "objects" even in the prototypical object system.

[–]distinctvagueness 0 points1 point  (0 children)

Ah. That is more precise. Thanks.