We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ef04c1 commit fc85130Copy full SHA for fc85130
1 file changed
src/core/utilities.js
@@ -55,9 +55,9 @@ export function diff (a, b) {
55
* @param {Array} array
56
* @return {boolean}
57
*/
58
-export function inArray (elem, array) {
59
- return array.indexOf(elem) !== -1;
60
-}
+export const inArray = Array.prototype.includes
+ ? (elem, array) => array.includes(elem)
+ : (elem, array) => array.indexOf(elem) !== -1;
61
62
/**
63
* Recursively clone an object into a plain array or object, taking only the
0 commit comments