Skip to content

Bikeshedding syntax: Appropriate to use square brackets? #2

@littledan

Description

@littledan

In JavaScript, currently, [ ] consistently has the semantics of property access (not just array access). This proposal gives them a second usage, as a way to create slice, based on whether the contents of the brackets contains a colon. I think we should be careful about this--it might lead to confusion. I wonder if some other tokens might be more appropriate here, even though it'd be unfortunate to move away from the convention that we have from Python and CoffeeScript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions