Is the visitor pattern good?

There are at least three very good reasons for using the Visitor Pattern: Reduce proliferation of code which is only slightly different when data structures change. Apply the same computation to several data structures, without changing the code which implements the computation.

Read more

Are event listeners functions?

The EventListener interface represents an object that can handle an event dispatched by an EventTarget object. Note: Due to the need for compatibility with legacy content, EventListener accepts both a function and an object with a handleEvent() property function. This is shown in the example below.

Read more