Level 1M8Lesson 8.3

beginner45 minby DevFox

throw and try / catch

Make a function refuse a value it cannot work with by throwing an error instead of giving back a fake answer, and catch that error with try and catch so the program carries on. Read the error’s message once you have checked that it is one.

  • Fundamentals
  • TypeScript
`throw` and `try` / `catch`. Read this lesson at .