method Console.assert
Jump to headingConsole.assert(condition?: boolean,...data: any[],): void
Tests that an expression is true. If not, logs an error message
Examples Jump to heading
Jump to heading
Example 1
Example 1
console.assert(1 === 1, "This won't show");
console.assert(1 === 2, "This will show an error");
Parameters Jump to heading
optional
Jump to headingcondition: boolean
The expression to test for truthiness
Jump to heading<span>...data</span>: any[]
Return Type Jump to heading
void