ErrorEvent: filename property
HTML DOM
HTML DOM
The filename read-only property of the ErrorEvent interface returns a string containing the name of the script file in which the error occurred.
Value
A string.
Examples
window.addEventListener("error", (ev) => {
console.log(`The error occur in file: ${ev.filename}`);
});