check if value exists in associative array javascript