check if value exists in multidimensional array javascript