Lea Verou 12/14/2018

ReferenceError: x is not defined?

Read Original

This article details a JavaScript developer's experiment to reliably identify 'variable not defined' ReferenceErrors within a try-catch block. It presents findings from testing error messages across numerous browsers (Chrome, Firefox, Safari, Edge, IE) and provides a code snippet using a regex pattern to detect these specific errors, while acknowledging the inherent risks of this approach.

ReferenceError: x is not defined?

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

1
ServiceNow and Microsoft Copilot
Marius Sandbu 1 votes
2
The Learning Loop and LLMs
Martin Fowler 1 votes