Check Duplicate Value In Array Javascript Function