MCQs > IT & Programming > Node.js > Carefully read the following code: 1. var EventEmitter = require('events').EventEmitter; 2. var example = new EventEmitter(); 3. example.on('data', function sample1(){}); 4. example.on('data', function sample2(){}); 5. console.log(???); Which of the given options should replace ??? in line 5 of the above-given code snippet to obtain the following output? [ [Function: sample1], [Function: sample2] ]

Node.js MCQs

Carefully read the following code:

1. var EventEmitter = require("events").EventEmitter;

2. var example = new EventEmitter();

3. example.on('data', function sample1(){});

4. example.on('data', function sample2(){});

5. console.log(???);

Which of the given options should replace ??? in line 5 of the above-given code snippet to obtain the following output? [ [Function: sample1], [Function: sample2] ]

Answer

Correct Answer:

example.listeners('data') 

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

More Node.js MCQ Questions

search

Node.js Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it