@E18e/Array.Prototype.Tosorted

/icons/calendar.svg

Last update

Aug 9, 2024

Array.prototype.tosorted Codemod

Introduction

This codemod replaces occurrences of the non-standard Array.prototype.tosorted method with the standard Array.prototype.toSorted method. This update aligns the code with modern JavaScript standards, improving both code clarity and performance.

Before

const sortedArray = someArray.tosorted();

After

const sortedArray = someArray.toSorted();

Build custom codemods

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

background illustrationGet Started Now