This website uses Cookies. Click Accept to agree to our website's cookie use as described in our Privacy Policy. Click Preferences to customize your cookie settings.
I got my answer how this filter function deletes duplicates
JavaScript Tutorial – 13 Jan 20
JavaScript: Remove Duplicates from an Array
In this tutorial, you will learn some techniques to to remove duplicates from an...
To remove duplicate entries in an array:
Expression : $myarray.filter((item, pos, a) => a.indexOf(item) == pos)
where $myarray is a normal array containing [“Fred”, “Wilma”, “Fred”, “Betty”, “Fred”, “Barney”]
Result : A new array containing [Fred, Wi...