Javascript Remove Duplicate Objects From Array Using Filter In R