Example 1
Example 2
Example 3
Example 4
1 <= actions.length <= 10values.length === actions.lengthAll test cases are valid, e.g. you don't need to handle scenarios when unsubscribing from a non-existing subscription.There are only 4 different actions: EventEmitter, emit, subscribe, and unsubscribe.The EventEmitter action doesn't take any arguments.The emit action takes between either 1 or 2 arguments. The first argument is the name of the event we want to emit, and the 2nd argument is passed to the callback functions.The subscribe action takes 2 arguments, where the first one is the event name and the second is the callback function.The unsubscribe action takes one argument, which is the 0-indexed order of the subscription made before.Example 1
Example 2
Example 3
Example 4
1 <= actions.length <= 10values.length === actions.lengthAll test cases are valid, e.g. you don't need to handle scenarios when unsubscribing from a non-existing subscription.There are only 4 different actions: EventEmitter, emit, subscribe, and unsubscribe.The EventEmitter action doesn't take any arguments.The emit action takes between either 1 or 2 arguments. The first argument is the name of the event we want to emit, and the 2nd argument is passed to the callback functions.The subscribe action takes 2 arguments, where the first one is the event name and the second is the callback function.The unsubscribe action takes one argument, which is the 0-indexed order of the subscription made before.