From fc851305b59ce4e95971051b20958d6e2d217f0d Mon Sep 17 00:00:00 2001 From: Izel Nakri Date: Tue, 24 Jan 2023 00:44:07 +0100 Subject: [PATCH] Core: Make inArray use Array.prototype.includes --- src/core/utilities.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/utilities.js b/src/core/utilities.js index 7bdd4dce6..9cd8e78b1 100644 --- a/src/core/utilities.js +++ b/src/core/utilities.js @@ -55,9 +55,9 @@ export function diff (a, b) { * @param {Array} array * @return {boolean} */ -export function inArray (elem, array) { - return array.indexOf(elem) !== -1; -} +export const inArray = Array.prototype.includes + ? (elem, array) => array.includes(elem) + : (elem, array) => array.indexOf(elem) !== -1; /** * Recursively clone an object into a plain array or object, taking only the