A

Admin • 828.03K Points
Coach

Q. Which of the following is the correct syntax for a function that throws an error?

  • (A) func test() throws -> Void
  • (B) func test() throw -> Void
  • (C) func test() throws -> Error
  • (D) func test() throw Void
  • Correct Answer - Option(A)
  • Views: 19
  • Filed under category Swift (iOs)
  • Hashtags:

Explanation by: Admin
`throws` is used before the return type to indicate the function can throw an error.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.