console.assert
logs a message only if a specified condition is false. This is useful for adding assertions to your code without disrupting normal program flow.
const age = 25;
console.assert(age >= 18, 'User is not an adult'); // No output since age >= 18 is true
console.assert(age < 18, 'User is not an adult'); // Output: Assertion failed: User is not an adult