Replace goog.array.contains with ol.array.includes
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user