@E18e/Array.Prototype.Keys

1.0.5Last update Aug 9, 2024
by@e18e

Array.prototype.keys Codemod

Introduction

This codemod replaces instances of Array.prototype.keys() with the more efficient usage of the keys() method directly. This change reduces unnecessary overhead in the code and enhances performance by leveraging built-in array methods more effectively.

Before

const array = ['a', 'b', 'c'];
const keys = array.keys();

After

const array = ['a', 'b', 'c'];
const keys = array.keys();

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now