Creates an array of common elements between two arrays.
The type of elements in the arrays.
The first array.
The second array.
An array containing the common elements between the two arrays.
import { createCommon } from "@std/internal/diff";import { assertEquals } from "@std/assert";const a = [1, 2, 3];const b = [1, 2, 4];assertEquals(createCommon(a, b), [1, 2]); Copy
import { createCommon } from "@std/internal/diff";import { assertEquals } from "@std/assert";const a = [1, 2, 3];const b = [1, 2, 4];assertEquals(createCommon(a, b), [1, 2]);
Creates an array of common elements between two arrays.