console.assert() method writes an error message to the console if the assertion is false. If the assertion is true, nothing happens.
Note: This feature is available in Web Workers.
|expression||Required||Any boolean expression. If the assertion is false, the message is written to the console.|
Real Time Example
In the following example, we will try to get an id of an element which is not available.
Please do google search for:
Join Our Channel
This channel is primarily useful for Full Stack Web Developer.