Skip to content

chapter 2: code examples and descriptions are miscoordinated #54

Closed
@vsemozhetbyt

Description

@vsemozhetbyt

It seems there is a conflict between some editions:

Consider the next snippet, where a property named code wouldn’t have been as indicative of its contents as colorCode could be:

var { metadata: { gender: characterGender } } = character

The scenario we just saw repeats itself frequently, because properties are often named in the context of their host object. While palette.color.code is perfectly descriptive, code on its own could mean a wide variety of things, and aliases such as colorCode can help you bring context back into the variable name while still using destructuring.

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