E

e18e/@e18e/array.prototype.indexof

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

Array.prototype.indexOf Codemod

Introduction

This codemod transforms calls to array.prototype.indexof (with a lowercase "o") to the built-in indexOf method of arrays. This replacement reduces reliance on error-prone custom implementations and leverages the native functionality, improving code performance and readability.

Before

javascript

After

javascript

Ready to contribute?

Build your own codemod and share it with the community.