Games Node.js Loop Quest Events and errors
Cutting in line
One listener added with on, then one with prependListener.
const { EventEmitter } = require('node:events');const bus = new EventEmitter();bus.on('go', () => console.log('first added'));bus.prependListener('go', () => console.log('prepended'));bus.emit('go');1. Predict the output
Tap the lines in the order you think they print.
- 1…
- 2…