deno.com
method Console.assert
#Console.assert(
condition?: boolean,
...data: any[],
): void

Tests that an expression is true. If not, logs an error message

Examples #

#

Example 1

console.assert(1 === 1, "This won't show");
console.assert(1 === 2, "This will show an error");

Parameters #

optional
#condition: boolean

The expression to test for truthiness

#<span>...data</span>: any[]

Return Type #

void