ErrorEvent: colno property
The colno property is the column number where the error occurred.
Value
A number.
- Read-only. Assigning to it throws
TypeError. - It is always
0inerrorevents the runtime fires: the runtime doesn't report column numbers. Usefilenameandlinenoto find where the error occurred. - When the event is created with
newwithout it, it is0.
Examples
js
const event = new ErrorEvent('error', { message: '坏了', lineno: 3, colno: 7 });
console.log(event.lineno, event.colno);Result: prints 3 7.