replaced _.isArray with Array.isArray()