Node.js · Junior · Question 42 of 75

Is emitter.emit() synchronous or asynchronous?

Explanation

emit calls listeners one by one before it returns. A slow listener therefore blocks the code that emitted the event.

Further reading

Problem with a question

Node.js · Junior · question 42

Test yourself

Take the Node.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz