Javascript Create Distinct Array Optimization Algorithms In Deep