JavaScript Error.prototype.lineNumber Property Last Updated : 28 Apr, 2021 Comments Improve Suggest changes Like Article Like Report In JavaScript, the Error.prototype.lineNumber property helps us to determine which line in our code corresponds to an error. One important thing to note is that this property is not used extensively as it is not a standard feature. Syntax:errorVariable.lineNumber Example 1: JavaScript var ex_variable = 2; var er = new Error("Example Error"); if (ex_variable > 1) { throw er; } // Error is in the 5th line so log will show 5 console.log("Error is in line number " + er.lineNumber); Output: In the above example, the number 5 is printed in the logs as the 5th line is the line in which an error is thrown. Example 2: JavaScript window.addEventListener("error", function (er) { // Line number 7 throws an error, so output is 7 console.log("The error is thrown in the line " + er.lineNumber); }); var ex_var = 3; var er = new Error("Example error"); if (ex_var < 5) throw er; Output: When the error event is fired, the number 7 is printed in the logs as the 7th line is the line in which an error is thrown. Supported Browser: The Error.prototype.lineNumber property can only run on Firefox. Firefox Comment More infoAdvertise with us Next Article JavaScript Error.prototype.lineNumber Property A ashutoshrathi Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Errors Similar Reads JavaScript Number Prototype Property Number object in JavaScript is used to manipulate numbers whether it is negative or positive. The JavaScript Number type represents the double (fractional values) type numbers. A number literal like 98 is not an integer value but a floating-point value. It maintains the precision of 17 decimal place 4 min read JavaScript Error.prototype.stack Property To handle any error which occurs while execution, the methods of error handling are used. In these methods, the type of error where it is raised and reasons are given in a definite order or sequence. Stack Structures are used to store these sequences. In JavaScript, all errors and their details are 3 min read JavaScript Error.prototype.fileName Property The fileName is a non-standard property that contains the path of the file that raised this error. It is recommended to not use this property on production sites facing the web, as it may not work for every user. If called from the Firefox Developer Tools, "debugger eval code" is returned. This prop 2 min read JavaScript Error name Property In JavaScript, the Error name property is used to set or return the name of an error. Syntax: errorObj.name Property values: This property contains six different values as described below: SyntaxError: It represents a syntax error.RangeError: It represents an error in the range.ReferenceError: It re 2 min read JavaScript Error.prototype.columnNumber property The columnNumber is a non-standard property that contains the column number of the line at which the error was raised. It is recommended to not use this property on production sites facing the web, as it may not work for every user. Use: This property is useful while creating an error object. If th 2 min read Like