Skip to content

for-in loops over arrays should be avoided #79432

@bpasero

Description

@bpasero

There is a new TSLint rule to detect for-in use for arrays that I think would make sense to enable. We have only few violations.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in#Array_iteration_and_for...in and keep in mind that for-in may inherit properties from Object.

@alexr00 @dbaeumer

for (let position in keys) {

for (let index in task.configurationProperties.dependsOn) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    debtCode quality issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions