Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unary :: operator proposal #1220

Closed
michaelficarra opened this issue Mar 23, 2011 · 1 comment
Closed

unary :: operator proposal #1220

michaelficarra opened this issue Mar 23, 2011 · 1 comment

Comments

@michaelficarra
Copy link
Collaborator

We have the binary :: operator, as in Function::toString. I propose adding a prefixed unary version that behaves as if the binary operator's left operand was Object. This would make common tasks such as Object::hasOwnProperty (::hasOwnProperty) and Object::toString (::toString) shorter.

@jashkenas
Copy link
Owner

Nice idea, but I think it's too ambiguous. If I were looking at:

::toString

And I had never seen it before, besides looking like a typo, I'd assume that it referred to the prototype of the global object: window.prototype.toString.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants