Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Why no use .? as token? #61

@michaeljota

Description

@michaeljota

Hi,

I don't think I have enough experience about tokens in Javascript, but the current token could have some backwards compatibility issues, as far I can tell. In the spec said it at least.

Maybe this is not the reason this haven't go to stage two, but I would like to see this implemented. I understand that ?. could be confused with a ternary operator using a decimal number as the if clause.

But, can .? can be use instead? I know that ?. is used in other languages as well, but JS is special, we all know that.

Another thing about this, is that you can use properties, and function calls in the same way, so there is nothing unexpected here.

const foo = bar.?foo;
const res = bar.?fun();
const prop = bar.?[prop];

Like I say, I don't know that much about tokens, maybe this was in the table, but I just wanted to say it.

Thanks you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    alternative syntaxpast ideas and discussions about alternative syntaxes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions