Skip to content
This repository was archived by the owner on Mar 10, 2024. It is now read-only.
This repository was archived by the owner on Mar 10, 2024. It is now read-only.

Add .firstItem for symmetry #27

@zocky

Description

@zocky

I realize that this would be a trivial syntactic sugar for array[0], but

  • Symmetry is good. It makes the language easier to learn and the code easier to write and read.
  • Annoying the programmer is bad. If you often type .lastItem you will automatically start typing .firstItem even if it doesn't exist.
  • When using arrays with .shift() and .pop() (as opposed to iteration by index), using .firstItem and .lastItem makes the code more readable.

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