Replace goog.array.contains with ol.array.includes

This commit is contained in:
Frederic Junod
2015-09-28 16:57:24 +02:00
parent 504e67303f
commit 88c3891bef
7 changed files with 35 additions and 21 deletions

View File

@@ -37,6 +37,17 @@ ol.array.binaryFindNearest = function(arr, target) {
};
/**
* Whether the array contains the given object.
* @param {Array.<*>} arr The array to test for the presence of the element.
* @param {*} obj The object for which to test.
* @return {boolean} The object is in the array.
*/
ol.array.includes = function(arr, obj) {
return arr.indexOf(obj) >= 0;
};
/**
* @param {Array.<number>} arr Array.
* @param {number} target Target.