Console.assert() Method

The console.assert() writes a message to the console and Log.txt if an assertion is false.

Syntax

console.assert(assertion, message)

Parameters

Return value

None (undefined).

Example

> console.assert(1/2 == 0.5, "Hmmm...")
undefined
> console.assert(1 == 3, "I guess I can't do math!")
undefined
I guess I can't do math!

References