DEV Community

Discussion on: Introduction to Functional Programming

lukeshiru profile image
Luke Shiru • Edited on

You're right, I checked and the performance of my first approach in some scenarios is better, and in some others is the same or even worse. The second one is faster to both map and indexOf+slice. Still my main concern as I expressed previously is using a function meant to map all the elements of an array to just change the value of 1. I didn't checked the actual performance of this and it was kinda surprising, so thanks for pointing that out :D