Skip to content

Commit 6b45f96

Browse files
committed
Added how assert works in nodejs
1 parent a3a9473 commit 6b45f96

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,16 @@ myNew(function(err, res){
412412

413413
## Q. ***How assert works in Node.js?***
414414

415-
*ToDo*
415+
The assert module provides a way of testing expressions. If the expression evaluates to 0, or false, an assertion failure is being caused, and the program is terminated.
416+
417+
This module was built to be used internally by Node.js.
418+
419+
```
420+
// Sample usage
421+
422+
const assert = require('assert');
423+
assert(50 > 70, "50 is less than 70.");
424+
```
416425

417426
<div align="right">
418427
<b><a href="#">↥ back to top</a></b>

0 commit comments

Comments
 (0)