Skip to content

Incorrect solution in Chapter 7: Mutability, Deep Immutability with as const, Solution 2: Inferring Literal Values In Arrays #35

@absorpheus

Description

@absorpheus

What

In Chapter 7: Mutability, Deep Immutability with as const, Solution 2: Inferring Literal Values In Arrays, Option 1: Annotate the Entire Array

Solution 2: Inferring Literal Values In Arrays

The solution is incorrect because we are passing a readonly array to a function that accepts a mutable array.

View in the TypeScript Playground

Suggestion

Perhaps refactor this as "Attempt 1" and explain why it does not work

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