Key vocabulary

  • Parameters: "accepts / takes" + required/optional + type + name
  • Returns: "returns a [type]" / "resolves with" (async) / "rejects with" (async error)
  • Exceptions: "throws a [ExceptionType] if [condition]"
  • Arrays: "an array of strings" — not "some strings" or "multiple strings"
  • Side effects: "mutates" (changes in place) vs "returns a new" (no mutation)

Question 0 of 5

A function signature is: function createUser(name: string, age: number, isAdmin?: boolean): User
Which description of its parameters is most accurate?