@E18e/String.Prototype.Lastindexof

/icons/calendar.svg

Last update

Aug 9, 2024

String.prototype.lastindexof to lastIndexOf Codemod

Introduction

This codemod transforms the usage of the deprecated string.prototype.lastindexof method to the standardized lastIndexOf method. This change not only ensures better compatibility with modern JavaScript standards but also helps to optimize the codebase by reducing unnecessary method calls.

Before

const str = 'Hello, world!';
const index = str.lastindexof('o');

After

const str = 'Hello, world!';
const index = str.lastIndexOf('o');

Build custom codemods

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

background illustrationGet Started Now