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]);
  }
}

@@ -299,16 +299,19 @@
 elements
+, 0
 );%0A  %7D%0A 
@@ -382,16 +382,19 @@
 ments%5Bi%5D
+, i
 );%0A  %7D%0A%7D

add index to foreach