@E18e/Array.Prototype.Flatmap

/icons/calendar.svg

Last update

Aug 9, 2024

Array.prototype.flatmap Codemod

Introduction

This codemod updates any usage of the Array.prototype.flatmap method to the more efficient built-in Array.prototype.flatMap method. This change helps to reduce dependency on polyfills or external libraries, ultimately improving performance and reducing bundle size.

Before

const result = array.prototype.flatmap(arr, callback);

After

const result = arr.flatMap(callback);

Build custom codemods

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

background illustrationGet Started Now