The reason for returning the `userList` array outside the `recurseUser` function is to accumulate all the subordinates of the manager in a single list.
When the `recurseUser` function is called recursively, it adds the subordinates to the `userList` array. If we were to return the `userList` array at the end of the `recurseUser` function, we would only get the subordinates of the first level and not the subordinates of the subsequent levels.
By accumulating the subordinates in a single `userList` array and returning it after all the recursive calls have completed, we get a complete list of all the subordinates of the manager up to the specified `maxLevel`.
So, returning the `userList` array outside the `recurseUser` function is a deliberate design decision to accumulate all subordinates in a single list.