# enum typeof

**URL:** <https://es.discourse.group/t/enum-typeof/1516>\
**Category:** 💡 Ideas\
**Created:** [November 10, 2022, 9:18pm UTC](https://es.discourse.group/t/enum-typeof/1516 "2022-11-10T21:18:53Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![theScottyJam](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/thescottyjam/32/616_2.png) [@theScottyJam](https://es.discourse.group/u/theScottyJam)\
**Post date:** [November 12, 2022, 6:54am UTC](https://es.discourse.group/t/enum-typeof/1516/7 "2022-11-12T06:54:13Z")

</div>

IMO, the typeof operator is just broken. It treats "null" as type object, and it treats functions as a different type from objects (a function is an object, so it really doesn't make sense to have `typeof myFn === 'object'` not be true). Adding more features around this operator would just further establish its broken type-categorization system.

What I would really like to see, and [something that's been discussed a bit elsewhere](https://es.discourse.group/t/consider-adding-an-alternative-to-typeof-that-doesn-t-include-the-legacy-baggage-of-typeof/526/7), is for the language to add a replacement to the typeof operator. Perhaps, as part of that discussion, needs involving the ability to programmatically access the different available types without hard-coding a list of types can be addressed

Though... to be honest, I've never actually ran into a concrete use-case where having a way to programmatically get my hands on all of the possible outputs of typeof would be handy, so it's hard to picture the utility of that.

---

_[View the full topic](https://es.discourse.group/t/enum-typeof/1516)._
