此頁面由社群從英文翻譯而來。了解更多並加入 MDN Web Docs 社群。
Error:columnNumber
Non-standard: 此功能尚未標準化。我們不建議在生產環境中使用非標準功能,因為它們的瀏覽器支援有限,且可能變更或被移除。然而,在沒有標準選項的特定情況下,它們可以作為合適的替代方案。
Error 實例的columnNumber 資料屬性,包含引發此錯誤的檔案該行中的欄號。
In this article
值
一個正整數。
Error:columnNumber 的屬性特性 | |
|---|---|
| 可寫 | 是 |
| 可列舉 | 否 |
| 可配置 | 是 |
範例
>使用 columnNumber
js
try { throw new Error("無法解析輸入");} catch (err) { console.log(err.columnNumber); // 9}規範
不屬於任何標準。