Amy Blankenship
Jun 10, 2022

--

The argument I could see for doing this is where you use ||, those are actually different use cases. If you look at case that way, you could have (which arguably expresses the actual cases better)

case a.id === first:

case b.id === last:

return -1;

//stuff

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

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

No responses yet