@E18e/Array.Prototype.Findlastindex

1.0.5Last update Aug 9, 2024
by@e18e

Array Prototype Find Last Index Codemod

Introduction

This codemod transforms the usage of the Array.prototype.findLastIndex method to its more efficient counterpart, ensuring consistent coding practices and potentially reducing bundle size by leveraging built-in ES features instead of polyfills or outdated methods.

Before

const array = [1, 2, 3, 4, 5];
const lastIndex = array.findLastIndex(element => element === 3);

After

const array = [1, 2, 3, 4, 5];
const lastIndex = array.findLastIndex(element => element === 3);

Build custom codemods

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

background illustrationGet Started Now