Example 1 — Example
Trigger or inspect.
JavaScript
try { const f = null; f(); } catch (e) { console.log(e.name); }How It Works
- Run the snippet.
- Inspect the error name.
TypeError — Wrong type for an operation (calling a non-function, etc.).
try { const f = null; f(); } catch (e) { console.log(e.name); }Trigger or inspect.
try { const f = null; f(); } catch (e) { console.log(e.name); }CODETOFUN NEWS
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
6 people found this page helpful