javascript determine if array