Games Node.js Loop Quest Events and errors
emit is synchronous
An EventEmitter with one listener. Is emit async?
const { EventEmitter } = require('node:events');const bus = new EventEmitter();bus.on('order', () => console.log('listener'));console.log('before');bus.emit('order');console.log('after');1. Predict the output
Tap the lines in the order you think they print.
- 1…
- 2…
- 3…