DEV Community

Discussion on: How to remove duplicates from JavaScript array

Collapse
 
hi_iam_chris profile image
Kristijan Pajtasev

That is a good question, sort is a destructive function. This means running sort on numbers array will change original numbers array.

Thread Thread
 
ibnsamy96 profile image
Mahmoud Ibn Samy

wow I forgot that