I am looking at the source for Node.js event emitter

<https://github.com/nodejs/node/blob/master/lib/events.js>

I am trying to figure out how the code identifies a function, specifically when using `addListener`/`removeListener`

those functions both accept a signature of (String s, Function f)

but what I don't understand is how they identify which function to remove when removeListener is called, as there may be multiple functions that serve as callbacks for the same event.

I suppose I am specifically wondering how this line

```
list[i] === listener

```

that is, comparing two functions for equality, works in JS