错误:columnNumber

Non-standard: This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Error 实例的 columnNumber 数据属性包含引发此错误的文件行中的列号。

¥The columnNumber data property of an Error instance contains the column number in the line of the file that raised this error.

¥Value

正整数。

¥A positive integer.

Property attributes of 错误:columnNumber
Writable yes
Enumerable no
Configurable yes

示例

¥Examples

使用列号

¥Using columnNumber

js
try {
  throw new Error("Could not parse input");
} catch (err) {
  console.log(err.columnNumber); // 9
}

规范

¥Specifications

不属于任何标准。

¥Not part of any standard.

浏览器兼容性

BCD tables only load in the browser

¥Browser compatibility

也可以看看