use Array.isArray in spread