Skip to content

typeof variable === "object" potentially problematic #249

@mjsarfatti

Description

@mjsarfatti

On the type checking section the following is recommended to see if a variable is an object:

typeof variable === "object"

The problem is that:

typeof null === "object"

So the recommendation should probably read:

typeof variable === "object" && variable !== null

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions