DEV Community

Discussion on: How not to sort an array in JavaScript

Collapse
 
macorifice profile image
Stefano

Hi Phil,
would not have been the case to use lodash for undefined and null ?

Collapse
 
vjarysta profile image
Valentin Jarysta • Edited

This would have worked as well, therefore you might not need lodash.

Collapse
 
philnash profile image
Phil Nash

Hi Stefano, not sure what you mean there. Could you explain more?

Collapse
 
macorifice profile image
Stefano
Thread Thread
 
pavelloz profile image
Paweł Kowalski

Wow. Using lodash for that. Wow. :)

Thread Thread
 
philnash profile image
Phil Nash

Oh, sure, I could have used that. I’d probably prefer to just use an array filter though, as I do later in the post, as it will only filter the things I want and don’t incur the overhead of requiring a library like (or even just a function from) lodash.