]> git.openstreetmap.org Git - rails.git/blob - app/assets/javascripts/compat.js
Implement Array.forEach for browsers which don't have it
[rails.git] / app / assets / javascripts / compat.js
1 /*
2  * Implement Array.forEach for browsers which don't have it
3  */
4 if ( !Array.prototype.forEach ) {
5   Array.prototype.forEach = function(fn, scope) {
6     for(var i = 0, len = this.length; i < len; ++i) {
7       fn.call(scope || this, this[i], i, this);
8     }
9   }
10 }