aboutsummaryrefslogtreecommitdiff
path: root/lib/util.js
blob: 3c6857c8395fd37e421d653faaab5ae4603c4da7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
HTMLCollection.prototype.map = function(fn) {
	var results = [];
	for (var idx = 0; idx < this.length; idx++) {
		results.push(fn(this.item(idx)));
	}
	return results;
};

HTMLCollection.prototype.forEach = function(fn) {
	for (var idx = 0; idx < this.length; idx++) {
		fn(this.item(idx));
	}
};