- Regarding the emitter, the provided subscribe function was as follows:
The follow-up questions were detailed, such as asking about callback.apply(this, args);
and why ‘this’ is needed. Also asked how to ensure the callback is unique when subscribe is executed twice. To be honest, I was a bit confused by the questions. The solution provided was to add a flag to check the callback or wrap it in an object.
sub = emitter.subscribe('event_name', callback);
sub2 = emitter.subscribe('event_name', callback);
- Two identical DOM trees
Follow-up: Worst case scenario
This question didn’t stump me.
Job hunting is truly exhausting, and luck has not been on my side. If I didn’t answer the follow-up questions well this time, does that mean it’s over? Would appreciate some good vibes or blessings.