• +91 9723535972
  • info@interviewmaterial.com

NodeJS Interview Questions and Answers

Question - Why is assert used in Node.js?

Answer - Assert is used to explicitly write test cases to verify the working of a piece of code. The following code snippet denotes the usage of assert: var assert = require('assert'); function add(x, y) { return x + y; } var result = add(3,5); assert( result === 8, 'three summed with five is eight');

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners