> I agree with Tom, "object" is the best choice if we are to avoid extending 
> typeof's codomain. If we choose to extend, then your best case made above 
> arguess for "symbol", not "string".


I’ve been wondering: instead of fixing typeof, wouldn’t it be simpler to extend 
instanceof, by introducing new types:

- ReferenceType: to check whether a value is an object. Currently, objects such 
as Object.create(null) and Object.prototype are objects that are not instanceof 
Object.
- ValueType: for primitives and possibly future value objects.
    - PrimitiveBoolean: for primitive booleans, same as typeof x === 'boolean'
    - etc.

Should there ever be guards in the future, instanceof MyGuard would also make 
sense.

Axel

-- 
Dr. Axel Rauschmayer
[email protected]

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to