forEachEntry = (obj, fn) => {
  const generator = obj && obj[Symbol.iterator];

  const iterator = generator.call(obj);

  let result;

  while ((result = iterator.next()) && !result.done) {
    const pair = result.value;
    fn.call(obj, pair[0], pair[1]);
  }
}
For each entry in the object, call the function with the key and value.

@param {Object<any, any>} obj - The object to iterate over.
@param {Function} fn - The function to call for each entry.

@returns {void}