Error.prototype.columnNumber
非标准: 该特性是非标准的,请尽量不要在生产环境中使用它!
Error
实例的 columnNumber
数据属性包含引发此错误的文件行中的列号。
值
正整数。
Error.prototype.columnNumber 的属性特性 | |
---|---|
可写 | 是 |
可枚举 | 否 |
可配置 | 是 |
示例
使用 columnNumber
js
try {
throw new Error("无法解析输入");
} catch (err) {
console.log(err.columnNumber); // 9
}
规范
不属于任何规范。
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
columnNumber |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Non-standard. Check cross-browser support before using.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.