MCQs > IT & Programming > Node.js > What will be the output of the following code snippet in Node.js? var inherits = require(function Parent(){ this.message ='Example '; } Parent.PrototyPe.exP = function(){ return this.message + 'parent class ' }; function Child(){Parent.call(this); } inherits(Child, Parent); Child.prototype.exp = function () { return Parent.prototype.exp.call(this) + 'child class'; } var chd = new Child(); console.log(chd.exp());

Node.js MCQs

What will be the output of the following code snippet in Node.js?

var inherits = require(function Parent(){

this.message ='Example ';

}

Parent.PrototyPe.exP = function(){ return this.message + 'parent class ' };

function Child(){Parent.call(this);

} inherits(Child, Parent);

Child.prototype.exp = function () { return Parent.prototype.exp.call(this) + 'child class';

}

var chd = new Child();

console.log(chd.exp());

Answer

Correct Answer:

Example parent class child class

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Node.js Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Node.js Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it