old_contents: import { getSelectorAll } from './getSelectorAll';
  import { getElement } from './getElement';
  import { isDomElement } from './isDomElement';
  
  export function forEach (elements, callback) {
    if (!elements) return;
  
    if (!(elements instanceof Array || elements instanceof NodeList)) {
      callback(elements);
    }
    else {
      let i = elements.length;
      while(i--) callback(elements[i]);
    }
  }
  
new_contents: import { getSelectorAll } from './getSelectorAll';
  import { getElement } from './getElement';
  import { isDomElement } from './isDomElement';
  
  export function forEach (elements, callback) {
    if (!elements) return;
  
    if (!(elements instanceof Array || elements instanceof NodeList)) {
      callback(elements, 0);
    }
    else {
      let i = elements.length;
      while(i--) callback(elements[i], i);
    }
  }
  
subject: add index to foreach