Find Duplicate In Array Using Javascript For Navigation