Amy Blankenship
May 20, 2023

Is it?

https://jsperf.app/cuqiqi/2

Seems to me you have a significant risk that i could be a number that could cause items[i] to throw an error (you don't have a bounding condition i < items.length. Maybe that's why people think it's too clever--you can't look at it and tell if it's going to error or not.

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

Full Stack developer at fintech company. I mainly write about React, Javascript, Typescript, and testing.

Responses (1)