Switched from custom isArray function to the native Array.isArray method.