The TypeError object represents an error when an operation could not be performed, typically (but not exclusively) when a value is not of the expected type.
@example
import{ TypeError }from'@w5s/error'; try{ thrownewTypeError("Hello"); }catch(e){ console.log(e instanceofTypeError);// true console.log(e.message);// "Hello" console.log(e.name);// "TypeError" console.log(e.stack);// Stack of the error }
Alias to native globalThis.TypeError
The TypeError object represents an error when an operation could not be performed, typically (but not exclusively) when a value is not of the expected type.