Skip to content

Commit fc85130

Browse files
committed
Core: Make inArray use Array.prototype.includes
1 parent 4ef04c1 commit fc85130

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/core/utilities.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ export function diff (a, b) {
5555
* @param {Array} array
5656
* @return {boolean}
5757
*/
58-
export function inArray (elem, array) {
59-
return array.indexOf(elem) !== -1;
60-
}
58+
export const inArray = Array.prototype.includes
59+
? (elem, array) => array.includes(elem)
60+
: (elem, array) => array.indexOf(elem) !== -1;
6161

6262
/**
6363
* Recursively clone an object into a plain array or object, taking only the

0 commit comments

Comments
 (0)