title: How is JavaScript .on() method defined?
body: <p>In the jQuery library, the function doesn't exist, yet every jQuery object has these essential methods. In another thread, it was stated that .on() belongs to the node API, which confuses me, since it can be used in the front-end and I don't even need to include <code>const EventEmitter = require('events');</code> and neither does the jquery.min.js. I just would like to learn about why for example the strings 'click' or 'mouseover' are valid arguments. </p>
  
  <p>Also, the on() method makes extensive use of callback functions. 
  For example:
  <code>$('class').on('click', event =&gt; {...})</code></p>
  
  <p>I would like to understand why it can be passed a lambda function or 'event' as stated above. </p>
  
  <p>Also, some might find the following resource useful, however, it is not really that straightforward and made me come up with more questions than answers:
  <a href="https://nodejs.org/docs/latest/api/events.html" rel="noreferrer">https://nodejs.org/docs/latest/api/events.html</a></p>