@E18e/Last Index Of

/icons/calendar.svg

Last update

Aug 9, 2024

Last Index Of Codemod

Introduction

This codemod replaces the use of a custom last-index-of module with the built-in Array.prototype.lastIndexOf method. This transformation simplifies the codebase by removing the dependency on an external module and utilizes a native JavaScript feature for improved performance.

Before

import lastIndexOf from 'last-index-of';
const index = lastIndexOf(array, value);

After

const index = array.lastIndexOf(value);

Build custom codemods

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

background illustrationGet Started Now