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)
}
// assume simple dom element
return fn.call(context, els)
}