Commit a2090450 authored by Antek Grzanka's avatar Antek Grzanka

Array find polyfill for IE support.

parent b3f5c601
......@@ -317,6 +317,30 @@
(function(){
// array prorotype find polyfill
if (!Array.prototype.find) {
Array.prototype.find = function(predicate) {
if (this == null) {
throw new TypeError('Array.prototype.find called on null or undefined');
}
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function');
}
var list = Object(this);
var length = list.length >>> 0;
var thisArg = arguments[1];
var value;
for (var i = 0; i < length; i++) {
value = list[i];
if (predicate.call(thisArg, value, i, list)) {
return value;
}
}
return undefined;
};
}
document.onStationChosen = function(node){
selectedStation = node.getAttribute('value');
updateView(node.getAttribute('name'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment