code: function addHooks(fn, value) {
    // Upcast val to an array
    var values = value;
    if (!Array.isArray(values)) {
      values = [value];
    }
  
    // Call each of the functions with hook
    values.forEach(fn);
  }
docs: Helper function to add hooks