Files
pjax/lib/foreach-els.js
2014-10-14 08:23:56 +02:00

8 lines
262 B
JavaScript

module.exports = function(els, fn, context) {
if (els instanceof HTMLCollection || els instanceof NodeList || els instanceof Array) {
return Array.prototype.forEach.call(els, fn, context)
}
// assume simple dom element
return fn.call(context, els)
}