You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
369 B

4 years ago
"use strict";
var forOf = require("es6-iterator/for-of")
, isIterable = require("es6-iterator/is-iterable")
, iterable = require("./validate")
, forEach = Array.prototype.forEach;
module.exports = function (target, cb/*, thisArg*/) {
if (isIterable(iterable(target))) forOf(target, cb, arguments[2]);
else forEach.call(target, cb, arguments[2]);
};