Sur cette pageSyntaxError Alias to native globalThis.SyntaxError The SyntaxError object represents an error when trying to interpret syntactically invalid code. It is thrown when the JavaScript engine encounters tokens or token order that does not conform to the syntax of the language when parsing code.@exampleimport { SyntaxError } from '@w5s/error';try { throw new SyntaxError("Hello");} catch (e) { console.log(e instanceof SyntaxError); // true console.log(e.message); // "Hello" console.log(e.name); // "SyntaxError" console.log(e.stack); // Stack of the error}HierarchyErrorSyntaxErrorIndex ConstructorsconstructorPropertiesnameConstructors externalconstructornew SyntaxError(message): SyntaxErrornew SyntaxError(message, options): SyntaxErrorProperties namename: SyntaxError
Alias to native globalThis.SyntaxError
The SyntaxError object represents an error when trying to interpret syntactically invalid code. It is thrown when the JavaScript engine encounters tokens or token order that does not conform to the syntax of the language when parsing code.