★ Constructor
The `TypeError` object constructor
TypeError()
TypeError()
Creates a TypeError
instance that represents type error with the message built of the given described problem and its solution, optional type, and an explicit identification on the supplied or stored error message template.
type-error.class.ts
Parameters
Description of the problem of a string
type.
A solution to the given problem
of a string
type.
Optional unique identification to the given problem
of generic type variable Id
.
type?:
Type
type?:
Type
The optional type of generic type variable Type
that causes an error to be thrown(or not thrown).
Optional template of the error message of string
type with the replaceable {problem}
, {fix}
and optional {id}
, {type}
tags. By default, the value is equal to the static property TypeError.template
.
Example usage
Last updated