@putout/plugin-remove-useless-array-entries
🐊Putout plugin adds ability to remove useless array.entries()
Last updated a year ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-remove-useless-array-entries 
SYNC missed versions from official npm registry.

@putout/plugin-remove-useless-array-entries NPM version

The entries() method returns a new Array Iterator object that contains the key/value pairs for each index in the array.

(c) MDN

????Putout plugin adds ability to remove useless array.entries().

Install

npm i @putout/plugin-remove-useless-array-entries

Rule

{
    "rules": {
        "remove-useless-array-entries": "on"
    }
}

❌ Example of incorrect code

for (const [, element] of array.entries()) {
    console.log(element);
}

✅ Example of correct code

for (const element of array) {
    console.log(element);
}

License

MIT

Current Tags

  • 2.0.1                                ...           latest (3 months ago)

3 Versions

  • 2.0.1                                ...           3 months ago
  • 2.0.0                                ...           a year ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (6)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |