Check Same Value In Array Javascript Function