Skip to content

Instantly share code, notes, and snippets.

View Keithg5's full-sized avatar

Keith Giddings Jr Keithg5

  • 16 Things Kids Can Do Inc
  • Laurel, Maryland.
View GitHub Profile
@Keithg5
Keithg5 / eventemitter.js
Created April 24, 2020 01:43 — forked from mudge/eventemitter.js
A very simple EventEmitter in pure JavaScript (suitable for both node.js and browsers).
/* Polyfill indexOf. */
var indexOf;
if (typeof Array.prototype.indexOf === 'function') {
indexOf = function (haystack, needle) {
return haystack.indexOf(needle);
};
} else {
indexOf = function (haystack, needle) {
var i = 0, length = haystack.length, idx = -1, found = false;