Use isArray instead of instanceof