Why if() takes more arguments than 3?

I saw such a example code in APPIAN DEVELOPER course practice document. (Expressions: Transform Your Data, Build an Application: Step 4)

I couldn't understand why if() coukd take arguments more than 3. The usage of if() should be "if(condition, valueIfTrue, valueIfFalse)" according to official doc.

proper(
  if(
    isnull(ri!user),
    "",
    isusernametaken(ri!user),
    user(ri!user, "firstName") & " " & user(ri!user, "lastName"),
    joinarray(split(ri!user, "."), " ")
  )
)

  Discussion posts and replies are publicly visible