Proposal: Symbol Linked to `typeof`

ViliusCreator viliuskubilius416 at
Tue Jan 15 19:35:08 UTC 2019

I could definitely see usage of this when using custom Constructors. But this could confuse current code of JS:

function A(B, C) {
    if(typeof B === ‘string’) // ...
A({[Symbol.typeof]: ‘string’})

This would make new code to use not only `typeof B === ‘String’`, but also `B instanceof ‘String’`.

This email has been checked for viruses by Avast antivirus software.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list