Delete All Duplicate Elements From Array Javascript Function Call