diff --git a/src/utils/arrayOperation.ts b/src/utils/arrayOperation.ts new file mode 100644 index 0000000000000000000000000000000000000000..82ad39d0f2dcc0a478ac570c1217948ef7960f42 --- /dev/null +++ b/src/utils/arrayOperation.ts @@ -0,0 +1,14 @@ +// Judge whether two array strings are the same +export function judementSameArr(newArr: unknown[] | string[], oldArr: string[]): boolean { + const news = removeDuplicate(newArr); + const olds = removeDuplicate(oldArr); + let count = 0; + const leng = olds.length; + for (let i in olds) { + for (let j in news) { + if (olds[i] === news[j]) count++; + } + } + return count === leng; +} +