JavaScript Error.prototype.columnNumber property Last Updated : 10 Feb, 2023 Comments Improve Suggest changes Like Article Like Report 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 the column number is undefined for any error object, you can define it manually. Syntax: error.columnNumber Example 1: JavaScript try { // Creating a new error object var err = new Error ("Format not supported","filename",0); if(err.columnNumber == undefined) err.columnNumber = 0; throw err; } catch(e) { // Printing error message console.log ("Error: " + e.message); // Printing column number of line // at which error was raised console.log ("At Column number: " + e.columnNumber); } Output: Error: Format not supported At Column number: 0 Example 2: JavaScript try { // Creating new error object var err = new Error ("Unexpected token output","filename",0); if(err.columnNumber == undefined) err.columnNumber = 0; throw err; } catch(e) { // Printing error message console.log ("Error: " + e.message); // Printing column number of line // at which this error was raised console.log ("At Column number: " + e.columnNumber); } Output: Error: Unexpected token output At Column number: 0 Browser compatibility(Desktop): Firefox Browser compatibility(Mobile): Firefox for Android We have a complete list of Javascript Errors, to check those please go through the JavaScript Error Object Complete Reference article. Comment More infoAdvertise with us Next Article JavaScript Error.prototype.columnNumber property A abhinavjain194 Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Properties JavaScript-Errors Similar Reads 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.prototype.lineNumber Property 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_variab 1 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.toString() Method The Error.prototype.toString() method is an inbuilt method in JavaScript that is used to return a string representing the specified Error object. Syntax: e.toString() Parameters: This method does not accept any parameters. Return value: This method returns a string representing the specified Error o 1 min read Like