Files
pjax/lib/foreach-els.js

10 lines
297 B
JavaScript
Raw Normal View History

2014-10-14 11:42:36 +02:00
/* global HTMLCollection: true */
2014-05-04 08:45:05 +02:00
module.exports = function(els, fn, context) {
if (els instanceof HTMLCollection || els instanceof NodeList || els instanceof Array) {
return Array.prototype.forEach.call(els, fn, context)
}
2018-02-01 09:16:01 +00:00
// assume simple DOM element
2014-05-04 08:45:05 +02:00
return fn.call(context, els)
}