Course · Section 16: Asynchronous JavaScript: Promises, Async/Await, and AJAX · Lecture 275: Error Handling With try...catch
Implement `tryOrDefault(arr, index, fallback)` that reads `arr[index]` from a helper which throws when the index is out of range, returning `fallback` if it throws.
+ 1 hidden test run on Submit.
Wrapping a throwing accessor in try/catch lets you supply a fallback on bad indices.
Run your code to see results.