Get Duplicate Values From Array Javascript Length Function In R