Skip to content

docs: maybe an error in the-dangers-of-square-bracket-notation #110

@helicese

Description

@helicese

In issue2 of this doc
https://github.com/eslint-community/eslint-plugin-security/blob/main/docs/the-dangers-of-square-bracket-notation.md

you write

userInput = ['constructor', '{}'];
exampleClass[userInput[1]] = userInput[2];

but you may actually mean this

userInput = ['constructor', '{}'];
exampleClass[userInput[0]] = userInput[1];

I think you are using the wrong index

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